Help with PiCade game

Wondering if anyone can figure out why this game crashes on the Raspberry Pi. A 6th grader made it for a conference where we’re showing off our arcade cabinet builds and I would love for him to be able to show off his latest version.

Runs fine in the simulator and he has had previous versions working fine but recently did a bunch of work to add more. I guess I don’t know the limitations of the Pi Zero either.

Any help would be greatly appreciated.

2 Likes

Wow, that’s a lot of levels! I took a look at the code and it seems there are 11 forever loops being used. Every forever loops spawns its own dedicated thread when it executes its code and that takes up a lot of memory.

The on game update block in the game category is much more efficient (it does not spawn any threads). The only real gotcha is that you can’t use any pause blocks in on game update because it will slow down the game loop. Same goes for any other blocking functions (like play melody).

Looking at the code, it should be safe to swap them out because I don’t see any blocking calls.

2 Likes

Thanks, I’ll have him try that and see if that solves the issue.

I appreciate the advice.

Okay, I figured it out. Richard I got rid of the forever loops, which hopefully it is running more efficiently now, but it would still hang at the first dialogue box. I noticed that there were some tile rules being put into effect before the tilemap was first defined. Making sure that the tilemap got defined right at the get go seemed to fix things.

Generally there should be no memory problems on the Pi, it has like half gig (compared to 100k-200k in hardware boards).

1 Like

@senorlloyd could you post the updated game?

arcade-The-Platformer

1 Like