Hi Guys,
I'm trying to understand, and recode the way Shine's Snake game works.
I have a rough idea how to follow it, but have some questions.
How is it determined where the last segment of the snake is (the tail segment that is removed)?
Also, pretty much the same question, since the answer to any could probably answer both... how is the length of the snake kept track of?
Cheers, Art.
Shine's Lowser Snake Game
Moderators: Shine, Insert_witty_name
Shine's Lowser Snake Game
If not actually, then potentially.
I figure this:
code checking for an end game condition is like a next...for loop.
So the game must be keeping an array of coordinates of old snake heads.
Code: Select all
cell = cellTail
while cell ~= cellHead do
if cell.x == lastX and cell.y == lastY then
gameOver = true
break
end
cell = cell.next
end
So the game must be keeping an array of coordinates of old snake heads.
If not actually, then potentially.
-
- Posts: 47
- Joined: Mon Jan 03, 2022 10:15 am
- Location: http://product-of-china.cf/
- Contact:
-
How to create 2d snake game...?
without images,
By drawing rectangles for snake as body parts, Round shapes for food,
and adding score, lives, etc.
Please HELP...
without images,
By drawing rectangles for snake as body parts, Round shapes for food,
and adding score, lives, etc.
Please HELP...