Log In  

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.

Cart #snaek-1 | 2022-08-11 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

(Yes, I realize the cart id is "snaek"

P#115624 2022-08-11 21:29 ( Edited 2022-08-12 23:11)

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!

P#117224 2022-09-11 22:01

[Please log in to post a comment]