dom96 / snake

A little snake game in Nim
http://picheta.me/snake/
MIT License
211 stars 9 forks source link

Left and top borders don't seem to wrap properly #11

Open matomatical opened 2 years ago

matomatical commented 2 years ago

When the snake slithers off the left or top border of the grid by a single square, the snake head does not immediately appear on the opposite side. There is a delay of one time step. If the snake head turns either direction during this delay, it next appears on the original side of the grid, in the square adjacent to the one it slithered off from.

For example (H=head, digit=body, dash=blank space):

Expected:

Time 0:
- - - H 1 2 3 -
- - - - - - - -
- - - - - - - - 

(press up)

Time 1:
- - - 1 2 3 - -
- - - - - - - -
- - - H - - - - 

(press right)

Time 2:
- - - 2 3 - - -
- - - - - - - -
- - - 1 H - - - 

Actual:

Time 0:
- - - H 1 2 3 -
- - - - - - - -
- - - - - - - - 

(press up)

Time 1:
- - - 1 2 3 - -
- - - - - - - -
- - - - - - - - 

(press right)

Time 2:
- - - 2 H/3 - - -
- - - - - - - -
- - - - - - - - 

H and 3 on the same grid square. Game over.