Snake 10 - Like to move :3

 avatar
TaktycznyBocian
plain_text
a year ago
448 B
7
Indexable
Never
func move_snake() :
	if add_point:
		delete_tiles(snake)
		var body_copy = snake_body.slice(0,snake_body.size() - 1)
		var new_head = body_copy[0] + snake_direction
		body_copy.insert(0, new_head)
		snake_body = body_copy
		add_point = false
	else:
		delete_tiles(snake)
		var body_copy = snake_body.slice(0,snake_body.size() - 2)
		var new_head = body_copy[0] + snake_direction
		body_copy.insert(0, new_head)
		snake_body = body_copy