User prompt
Make score text a monospace font
User prompt
Use a variable to store the score
User prompt
Add 1 score each time you get a food
User prompt
Make the text colour #1a2314
User prompt
Add a full screen background
User prompt
Calculate old head position before adding the direction vectors
User prompt
The first piece of body should move to where the head was, but not is
User prompt
Bug: the first body piece has the same position as the head
User prompt
Instead of using virtual X/Y , just use the snakeGraphics X/y
User prompt
Never change the snakes self x/y , only change the coordinates of the snake graphics within it
User prompt
Ensure the snake wraps
User prompt
Bug: Snake gets stuck after collecting food
User prompt
Ensure in self.directuon that virtual X is used for calculating the delta, not self.x/y
User prompt
Put the head into the body as it's the first element
User prompt
Don't set self.x/y to the virtual position, only set snake graphics X/y, as well as the first element in the body
User prompt
Move the snake graphics to the virtual X/y as well. And don't reset virtual X/y to the snake x/y every move
User prompt
When calculating direction, don't move the snake x/y , only keep a virtual X/y coord
User prompt
Iterate over the body in reverse to get the correct positions
User prompt
Keep a tick counter and only update movement every 5th
User prompt
Calculate body 0's position before looping over the body (and just loop till I=1)
User prompt
Set the head position first before doing the body.
User prompt
Decrease snake move speed by 5x , by tracking a tick counter and skipping them
User prompt
Decrease speed 5x
User prompt
Increase grid size to 128
User prompt
Ensure snake head snaps with the grid
===================================================================
--- original.js
+++ change.js