Runtime Generated Maze

Hello,

I’m looking to recreate a game I have made in Pico-8 which uses a maze generated when the game starts. I thought it would be worth getting some advise on what is the best way to go about:

  1. Maze generation (tilemaps or a mesh or a gui)
  2. Traps swapping (create sprite at each location or collect the tile positions and some timing for them)

My focus is on keeping the processing requirements and bundle size small as the game will be played on phones and through the a html5 bundle.

Any help is greatly appreciated.

Cheers,
Spen

Hey, nice game! A tilemap would be ideal for this. The trap could be a tile with a collision object that you enable/disable by swapping it for a different tile with tilemap.set_tile().

ps. This is just cruel!

4 Likes

ps. This is just cruel!

Haha, RNJesus can be a bitch!

Thanks so much for the advise and the playtest! I was thinking a similar way to what you have suggested, I’ll just need to make sure I generate the random timer for each trap tile and check it in the update function.

I love simple games like this. Instantly fun!

Another option that might be simpler is to create a repeating timer for each trap.

1 Like

I did not know there was a timer library in the API. Is the handle returned an object which you can add objects to? Like could I create the timer and get the timer handle, then add an position value for the trap that it connects to?

No. It can only be used to cancel a running timer.

So the timer is stateless, and would require an object which created the timer so that the corresponding trap to the timer can be referenced through self?

Edit: Or I could add the handle to a trap table along with the locations?

I’m not entirely sure what you are looking for but let me share the API ref:

-- a 2 second repeating timer
timer.delay(2, true, function(self, handle, elapsed)
    print(("Hello! %f seconds have elapsed since I last said hello"):format(elapsed))
end)

Yeah, this could work.