Need help with Pi 0 and it's menu system -- Made an arcade cabinet

Hey guys! I have build myself an arcade cabinet and set it up with a pi zero. I have two questions

  1. Can I overwrite games I’ve installed if they have the same file name? I accidentally installed the wrong version of one of my games. In order to delete it, I’d have to unscrew a panel to get at the SD card. I can do this, but it would sure be easier to just upload the right file using the same name.

  2. I’ve been looking at the code for the menu. After 5 minutes it launches a random game. I see that happens on line 159 of menu.ts. Is there anyway for me to change this so it launches a specific game and not a random one?

It was a great project but pretty difficult. The construction plans are pretty minimal and the instructions to set up the controllers and software are complete, but scattered all over the place. This is a project I did to practice so I can lead my students in building and programming one. I will probably create a new guide with everything in one place.

4 Likes

Do you want to load a game after five minutes, if so what game in particular? Or do you want to remove the idle statement altogether?

Hey! OK so I answered my own questions. I’ll put them here for future people that might be working on such issues.

  1. Can I overwrite games I’ve installed if they have the same file name?

No need to. You can delete games by pressing the MENU button and turning on SHOW ADMIN. Then, when you go back to your list of games, if you press the B_Button you can delete the selected game and then upload it.

  1. Is there anyway for me to change this so it launches a specific game and not a random one?

Yes. At line 155 find the code that reads:

    setInterval(function () {
        if (control.millis() - lastTick > DEMO_IDLE_TIME) {
            // nothing has happened for a while
            // start a random game
            select();

and make these changes

    setInterval(function () {
        if (control.millis() - lastTick > DEMO_IDLE_TIME) {
            // nothing has happened for a while
            // start a random game
            //select();
            control.runProgram("YourGameNameHere")

You can actually check the correct file name to type in the string by checking the “are you sure you want to delete…” prompt as mentioned above.

I wanted to do this to make a screen saver. I made one and loaded it and it worked fine. However, I didn’t like the screen saver hanging out on the list with all of my other games. So, if you add a period to your screen saver’s title in makecode arcade before you download it, it will be hidden from the list.

Just be sure to at the period to the code too like this:

        control.runProgram(".Screen_Saver")
2 Likes