Game crashes when snake fills up board
See original GitHub issueWhen you beat the game you get:
Uncaught TypeError: Cannot set property '-1' of undefined
at SNAKE.Food.me.randomlyPlaceFood (snake.js:541)
at SNAKE.Board.me.foodEaten (snake.js:981)
at SNAKE.Snake.me.eatFood (snake.js:365)
at SNAKE.Snake.me.go (snake.js:334)
at snake.js:335
In the console, and the game freezes.
edit: The line numbers are off since I was making changes.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Apex Crash - Code:Snake/Leaf - Answers HQ
So yesterday after a few games my game began to crash leading with weird Code goes by Snake/Leaf After a few more tries,...
Read more >Pygame seemingly crashes with no error message
I'm working on creating an AI to play the classic game Snake, and have implemented it somewhat successfully, ...
Read more >Programming Projects for Advanced Beginners #5: Snake
In Snake, the player pilots a snake around a grid, trying to eat apples and avoid crashing into walls or their own tail....
Read more >Game breaking bug/crash building snake year 2 - GameFAQs
So I'm at the beginning of Year 2 and to get to the next level I'm in Hogwarts and have to parseltongue a...
Read more >Killing snakes makes game crash. - Green Hell
Killing snakes makes game crash. Every time i kill a snake it crashes my game. Tried to kill with axe, stone knife, and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sure!
Just reproduced with small board size,
snakeSpeed
of 500 (the higher the slower, interesting…), andgrowthIncr
of 1. I get the following (removed absolute path from .js filename for brevity):Will look into it further.