The classic game Snake.
The code is well commented, and under the Creative Commons license, so you are free to learn/reuse code for your own games.
I have put this under the category Tutorials, however it could also be a Cartridge
The code has support for any size boundary, including changing the camera.
Because PICO-8 does not have autocorrect, I wrote boundry instead of boundary. Sorry!
v1.1 Hotfix fixes an issue where you would get a runtime error upon hitting a wall.
The correct version is now shown.
(Yes, I realize the cart id is "snaek"
Very nice! One neat addition you can make is to update the snake on every input as well as on every tick. I find that it makes the game feel more responsive and active. I believe Google's snake game uses that trick.
Thanks for posting!
[Please log in to post a comment]