Runtime Generated Maze

#1

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

0 Likes

#2

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!

39

4 Likes

#3

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.

0 Likes

#4

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

#5

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?

0 Likes

#6

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

0 Likes

#7

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?

0 Likes

#8

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)
0 Likes

#9

Yeah, this could work.

0 Likes