I have decided to make public my "game template" for the PICO-8. This is my starting point when I want to make a game.
It has a state machine, some utility functions (very basic) and an example of metatable usage (objects in Lua) with the Entity metatable. It includes a colision function (rectangles colision) for that Entity but it can be adapted to whatever you need.
I know there is another repository with something similar but I wanted to do my own mostly to learn and because everybody code differently.
You can get my template in this github repository
I hope this is helpful :)
Neat.. In your mod_zero function... is there a problem with PICO-8 Lua's % operator?
Oh I thought it didn't existed in PICO-8! I'm fairly new to Lua too so I did this to learn also. Thanks for pointing that out. That function can be changed then 😊
Nice. Maybe this can develop into a "living document" with more useful code-snippets that are used often for games. It is also a little bit the lua-philosophy. At lua-users they also host lots of snippets.
Hey misato thanks for this! I was just about to do something similar. Really helpful to see this way of representing entities in Lua for me.
Thanks again, and love the avatar!
[Please log in to post a comment]