klapstoelpiloot / pandemic

Pandemic Arcade-Style Shuffleboard
http://www.codeimp.com?p=pandemic
MIT License
7 stars 0 forks source link
arcade arcade-game arcade-machine arduino cpp fmod-library game-development gamedev led-matrix raspberry-pi

Pandemic: The Arcade-Style Shuffle Board

This is the sourcecode for the Pandemic shuffle board. The code is written for this purpose only. The code is public for you to learn from or to be inspired. You may use it, but only at your own risk. There is no warranty. Feel free to use the discussions section in GitHub for questions.

The IOModule code is made for the Arduino Nano Every. The Pandemic code is for the Raspberry Pi running Raspbian Lite (but it might work on other distros, I don't know). But the software is pretty useless without the hardware setup as described in the article. It needs the LED display and sensors and buttons via the Arduino, etc.

Build & Deployment

The IOModule code is easiest to compile and upload with the Arduino IDE, or with Visual Micro. It doesn't get more straight forward.

The Pandemic code is compiled on the Raspberry Pi using Visual Studio from a Windows machine connected to the same network. To make this work, you need to install the following packages on the Raspberry Pi:

sudo apt install zip rsync openssh-server build-essential gdbserver git

Visual Studio automatically copies the changed files to the Raspberry Pi and remotely builds the project. The binaries are built in ~/projects/Pandemic/bin/... with a Debug or Release subdirectory depending on the chosen build configuration.

There is a post-build action which should copy the required librgbmatrix.so library to the same output directory. This was previously built from Henner Zeller's rpi-rgb-led-matrix library. Follow his instructions to build that library.

To install fmod, download the fmod engine version 2.02.11 to the Raspberry Pi and unzip it in the ~/projects directory. This will create a subdirectory named fmodstudioapi20211linux which contains headers and dynamic link libraries. You may also choose to get a newer version or unzip it in any other location, but then don't forget to update the include paths in the project file before building. In the file /etc/ld.so.conf add a line to the directory containing the .so files: /home/pi/projects/fmodstudioapi20211linux/api/core/lib/arm64. Then run sudo ldconfig to apply the changes. You should now be able to compile and link fmod.

The file pandemic.toml is copied to the output directory on build. This file is read by the software on startup. You may want to make changes to this file depending on platform (RPI or VM) and personal preferences.

The data files must be in the directory /usr/local/games/data/, however, this is configurable in pandemic.toml. There is a handy batch file named Deploy_Data.bat to copy the data.

Using the simulator

To work on the software without any of the hardware, you must use the IOModule simulator and Raspberry Pi Desktop OS in a virtual machine.

Here is how to set it up:

If you did everything above, you should now be able to do this:

Video showing the IOModule simulator

Credits

Credit to whom credit is due. I'm using the following software libraries:

The following tools and resources were used: