I’ve made the grow food on the right places step, made a button and a reset function which is the same as the init function but the problem is that it gets the same as where it ended. I dunno what function/code to use here.

The problem is that you are modifying the tilemap of your game while it is being played (when the snake grows and when food is spawned). Your reset function doesn’t reset the tilemap.

I’d actually recommend that you reboot the engine:

msg.post("@system:", "reboot")

This essentially means that the entire game will restart. No state is saved and the init() function will be run again. Once you have a more complex game with a menu and so on it is likely that the game is loaded via a collection proxy and at that time it’s better to reload that proxy instead of the entire engine.

Been looking for that particular thing all day yesterday, thanks a lot!

Problem is, I can look around lua programming guide but I don’t know what should I be looking for since there are tons of groups and stuff that does stuff. But to be honest these defold tutorials are kinda easy to interpret and with a little dedication we can go step by step, I’ve been using code from each tutorial game to another to complete the extra steps.