One button action game, a living cake, wow the sweet taste of victory! https://cakefoot.dank.game
Go to file
Cocktail Frank 10621e5811 Add arcade cabinet daemon name to configuration
Add the configuration for the arcade cabinet daemon name to the arcade
cabinet specific config.

Start the arcade cabinet installation section in the README and update
it until the automatic updates section.
2025-02-26 16:07:53 -05:00
config Add arcade cabinet daemon name to configuration 2025-02-26 16:07:53 -05:00
doc Update history in press kit and add header and thumbnail assets 2024-12-18 20:13:50 -05:00
lib Add arcade cabinet daemon name to configuration 2025-02-26 16:07:53 -05:00
resource Add arcade cabinet operator menu 2025-02-13 00:04:30 -05:00
src Add arcade cabinet daemon name to configuration 2025-02-26 16:07:53 -05:00
www Define achievements and stats in config file 2024-09-03 19:35:04 -04:00
.gitignore Add 1.2.0 release highlights to README 2024-11-17 17:10:50 -05:00
.gitmodules ic 2023-05-23 15:35:29 -04:00
clang_sanitize_ignorelist.txt update gitignore 2023-06-19 20:43:07 -04:00
favicon.ico - add coins to ending 2023-12-04 21:55:11 -05:00
index.html Add arcade cabinet daemon name to configuration 2025-02-26 16:07:53 -05:00
LICENSE.txt update assets license, bug fix: check the correct level index when checking for a coin in the bank at level load 2024-05-11 00:57:51 -04:00
Makefile Add flag for preserving state of operator menu 2025-02-13 15:28:21 -05:00
Press_Kit.md Update press kit with achievements info and trailer 2025-01-16 14:53:48 -05:00
README.md Add arcade cabinet daemon name to configuration 2025-02-26 16:07:53 -05:00
robots.txt log the session ID to the JS console, check for data collection file existence before opening the file path 2024-07-09 20:31:39 -04:00

Fork it up! Cakefoot is a challenging, single-button dodge em up on rails. Pilot a walking cake hold to accelerate, let go to drift back and survive against all odds. Featuring 22 epic levels, arcade mode, unlockables, and high scores, Cakefoot is endlessly replayable, and impossible to defeat.

Cakefoot is one of the first games made with the open-source SPACE🪐BOX engine and is free to play online. It is the first game available for the dank.game web games portal.

Modding

The source code is not necessary for changing some parts of the game. For example, levels can be added or edited by editing the file resource/levels.json. Graphics and sound can be changed by editing texture file paths in config.json.

Since modding is not well documented yet, it is recommended to copy the entire build to another folder in case any save files get corrupted when running the mod. Additionally, any files modified should be saved to a backup for easy recovery.

Config and assets

Asset swaps, such as textures and sound, and some style edits, such as colors and fonts, are the easiest mods to do. Change the relevant values in config.json. In some cases, the values can even be changed while the game is running just by saving the file changes.

Levels

Levels in levels.json are also easy to add and mod using JSON, but the syntax is not documented yet. The shape of the curve, checkpoints, and enemies are all definable in the level syntax. Make sure to make a backup of the original file if modifying it.

Shaders

There are simple shader files in src/shaders/gl/. These can be edited to make graphics effects without recompiling the game.

Code

Other changes will require code edits. See the Build section.

Build

Clone both the game code and the SPACE🪐BOX engine code using --recursive. The engine code will be in lib/sb/ along with documentation and demos.

$ git clone --recursive https://open.shampoo.ooo/shampoo/cakefoot/

Each platform has a corresponding target in the Makefile. There is some documentation in the Makefile itself that should be checked. The current supported platforms are web browsers, Linux, Windows, and MacOS.

Until further documentation is added, one way to get started building for a platform is to first build the box demo for the desired platform in a separate project. This will ensure the dependencies for the game engine are installed.

Once the box demo is confirmed to build, try making a build of Cakefoot. For example, the Linux version can be built with the following command.

$ make Cakefoot-linux.x86_64

Arcade cabinet

Cakefoot can be configured to run in arcade-only mode, where it can run continuously, resetting itself between each round of play. If the system it is installed on is configured to power on and load the game automatically, an arcade cabinet or custom installation can be set up to power-on, launch, and run the game continuously, using just a power button. Free play and credits for commercial use are both supported. On Linux, it is also possible to set up automatic updates over Wi-fi.

Installation

The instructions below will install Cakefoot as an arcade system on a Linux mini PC. The instructions require a working Linux build of Cakefoot. It is possible to build the game directly on the system, but that is not covered by the instructions. See the Build section for how to get started building Cakefoot. Other builds, like Windows or macOS can also run in arcade-only mode with all features other than automatic updates, but the instructions do not cover those builds. See Andy Wallace's post for a method of installation on Windows that can be used with Cakefoot.

There some instructions specific to the Beelink MINI S PC. It should be possible to adapt the instructions for any PC, but hardware incompatibilities between the PC and Linux distribution may occur. For example, the instructions use version 13 of Debian Linux because version 12 does not support the Beelink MINI S Wi-fi drivers.

Create a bootable SD card for installing Linux

Create a bootable OS installer that will replace the Beelink MINI S PC's built-in Windows OS with Debian Linux 13. These instructions will use an SD card, but a USB stick can also be used. Make sure it is empty or unused because the contents will be erased.

  1. Download balenaEtcher for creating a bootable SD card. For example, this downloads version 1.19.25.

     wget https://github.com/balena-io/etcher/releases/download/v1.19.25/balenaEtcher-linux-x64-1.19.25.zip
     unzip balenaEtcher-linux-x64-1.19.25.zip
    
  2. Download the Debian testing netinst ISO. The following will download Debian 13 alpha.

     wget https://cdimage.debian.org/cdimage/trixie_di_alpha1/amd64/iso-cd/debian-trixie-DI-alpha1-amd64-netinst.iso
    
  3. Launch Balena etcher. It may be necessary to run as root, see the alternative command below if there are errors.

     balenaEtcher-linux-x64/balena-etcher
     # alternately: sudo balenaEtcher-linux-x64/balena-etcher --no-sandbox
    
  4. Load the Debian ISO and connect and select the SD card. Then press the "Flash" button.

  5. Once the SD card is flashed, remove it and connect it to the Beelink MINI S PC.

Install Debian

Replace Windows with Debian Linux using the installer. For further details on any of these steps or if any issues arise, see the Debian installation guide.

  1. Turn on the Beelink MINI S PC and press F7 to bring up the boot menu. Choose the option showing the SD card. For example, it might be something like UEFI: Generic MassStorageClass1536.

  2. The installer should load. Choose Graphical install. Then choose the appropriate language and keyboard settings.

  3. The installer should detect both ethernet and Wi-fi interfaces. Choose ethernet if using a wired connection. Otherwise, choose Wi-fi and set up the network.

  4. Choose the system name. It can be any single word, like "cakefoot". Leave the domain name blank.

  5. In the next screen, skip setting up the root user and just choose Continue. That will disable the root account and enable the first user account to be the administrator.

  6. Skip the full name entry by choosing Continue since it won't be relevant on this system.

  7. Enter a username for the user account, like "cakefoot". It's OK if it's the same as the system name. Then choose a password.

  8. Choose the appropriate time zone for the system.

  9. In the disk partitioning step, the entire hard drive will be erased and reformatted. Windows will be erased, but if it was previously activated, it can later be restored if necessary using an ISO downloaded from Microsoft. Choose Guided - use entire disk. Make sure to choose the PC's hard drive and not the SD card. In this case, the disk is SCSI1 (0,0,0)(SDA) - 512.1 GB ATA FORESEE 512GB SS. Then, choose All files in one partition and Finish partitioning and write changes to disk.

  10. Continue to install the minimal system.

  11. At the software selection screen, uncheck Debian desktop environment and GNOME. Check off only standard system utilities and SSH server. A desktop environment is not necessary for running Cakefoot.

  12. Once the software is installed, the installation should complete. Remove the SD card and choose Continue to reboot.

Transfer the build

This transfer method requires the build to be on a USB stick or SD card. Other transfer options include downloading the build and compiling from source on the PC.

  1. When the PC reboots, let the menu choose Debian automatically, and the login prompt will appear. Enter the username and password configured during installation.

  2. Increase the font size on the console if necessary. Choose Terminus and 16x32 to make the font large.

    sudo dpkg-configure console-setup
    
  3. Plug in the USB drive with the build, and look at the output of fdisk -l to find the drive's device name. In this case, it's /dev/sdb because the USB drive capacity is 16GB.

    > sudo apt install unzip
    > fdisk -l
    ...
    Disk /dev/sdb: 14.46 GiB
    ...
    
  4. Make a directory where the USB drive will be mounted, and mount the drive with permissions for all users to access the files.

    sudo mkdir /media/usb_drive
    sudo mount -o "uid=1000,gid=1000" /dev/sdb /media/usb_drive/
    
  5. Make a directory for the game. Transfer the build into the new folder and unzip it if it's not unzipped already. Finish by un-mounting the USB drive, so it can be unplugged safely.

    mkdir ~/cakefoot/
    cp -r /media/usb_drive/Cakefoot/Cakefoot-linux-1.4.2.zip ~/cakefoot/
    cd ~/cakefoot
    unzip Cakefoot-linux-1.4.2.zip
    sudo umount /media/usb_drive
    

Configure the OS and the game and run a test

Before running the game, some dependencies need to be installed, and some audio and video settings need to be edited.

  1. Install Open GL and SDL for video, and ALSA utils for audio.

    sudo apt update
    sudo apt install alsa-utils libsdl2-2.0-0 libsdl2-image-2.0-0 libsdl2-ttf-2.0-0 libsdl2-mixer-2.0-0 mesa-utils
    
  2. Remove SDL shared libraries from the build, so the libraries just installed are used instead. This seems to be necessary for using the KMS DRM video option with SDL, which is required when running the game without a windowing system.

    cd ~/cakefoot
    rm lib/libSDL2*
    
  3. Set the master volume and save the setting.

    amixer set Master 100%
    sudo alsactl store
    
  4. For the Beelink MINI S, AUX sound is now working. For other systems or for using HDMI instead of AUX, more configuration is required. Use the GUI alsamixer and the output of amixer to see which controls connect to HDMI. In this case, the controls for IEC958 are the HDMI settings. Make sure they are turned on.

    > amixer # or alsamixer
    ...Simple mixer control 'IEC958',0...
    ...Simple mixer control 'IEC958',1...
    ...Simple mixer control 'IEC958',2...
    ...Simple mixer control 'IEC958',3...
    > amixer set IEC958,0 on
    > amixer set IEC958,1 on
    > amixer set IEC958,2 on
    > amixer set IEC958,3 on
    > sudo alsactl store
    
  5. To set the sound to output to a specific device, for example HDMI, get the device number from aplay and create a configuration at ~/.asoundrc. This can be switched back later by replacing "device 3" with "device 0".

    > aplay -l
    ...
    card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [PROJECTOR]
    ...
    > echo -e 'defaults.pcm.!card 0\ndefaults.ctl.!card 0\ndefault.pcm.!device 3\ndefaults.ctl.!device 3' > ~/.asoundrc
    
  6. Add the user to the input group, so the game can read from input devices, and apply the setting.

    sudo usermod -a -G input $USER
    exec sudo su -l $USER
    
  7. Cakefoot needs to be configured to run in arcade-only mode. In this repository, there are configuration files at src/config_arcade.json and src/config_arcade_paid.json that can be placed in the config/ folder to configure arcade-only mode automatically. The second file configures the game to require a credit to be inserted, but that setting can be changed to any amount of credits, including 0 for free play, from an in-game menu. Some settings in these files can be modified if necessary. For example, to use a different screen resolution, the display > dimensions setting can be edited. If using the same USB drive method as above, transfer the configuration files onto the USB, and copy them into the config/ folder.

    cp /media/usb_drive/config_arcade.json /media/usb_drive/config_arcade_paid.json \
        ~/cakefoot/Cakefoot-linux/config/
    
  8. Cakefoot should now run successfully with sound and input in arcade-only mode. Launch the game and try playing with the keyboard.

    cd ~/Cakefoot-linux
    ./Cakefoot-linux.x64
    

Launch game on start up

The systemd tool can be used to configure the system to launch the game automatically at startup. The file src/cakefoot.service[src/cakefoot.service] is a configuration file that creates a systemd service to run Cakefoot. This file needs to be installed on the system.

  1. Use the USB drive to copy the file into the user's systemd configurations folder at ~/.config/systemd/user/, and run enable to add the service to the system.

    cp /media/usb_drive/cakefoot.service ~/.config/systemd/user
    systemctl --user enable cakefoot
    
  2. To allow the service to run without the user logging in, the user must be added to linger.

    sudo loginctl enable-linger $USER
    
  3. The service should run successfully. Because this service re-launches the game automatically when it quits, the command CTRL+SHIFT+q must be used to stop the service and fully quit the game.

    systemctl --user start cakefoot
    
  4. Reboot the system, and the game should load and run automatically.

    sudo reboot
    

Automatic updates

Auto Power-on

Edit a setting in the BIOS so the PC turns on automatically when power is connected. This allows the arcade cabinet to be turned on with just a power strip.

  • Turn on the PC and press F7 to bring up the boot menu. Choose "Enter Setup" in the menu that appears to enter the BIOS menu.
  • Go to "Chipset" > "PCH-IO Configuration" > "State After G3" and choose "S0 State" (see screenshots of the process)
  • Press F4 to save and exit BIOS.

Operator's menu

Press kit

There is a press kit included in Markdown format in the root of the repository. This can be converted into an HTML page using the conversion tool Pandoc. Once Pandoc is installed, run the make target from the terminal to generate a file press.html in the root folder.

$ make press

The generated page will look like this. To edit the press kit, for example if this repository is being used for a mod or another game, edit the markdown file, CSS rules, metadata, and optionally the template, and re-run the make target.

License

The code is open source under the zlib license, and the assets are released under the Creative Commons BY 4.0 license. This means the game can be legally copied, modified, and used commercially, as long as appropriate credit is given.

See LICENSE.txt for details, including how to provide credit.

Releases

Release versions are available to checkout using tags. This project uses semantic versioning.

1.4.2

  • Add an arcade operator's menu for configuring options applicable to the Cakefoot arcade cabinet
  • Add a credits system with configurable credit requirements to the arcade-only mode
  • Use new config search path feature to include config specific to web, arcade, and demo builds

1.4.1

  • Add idle timeout to arcade cabinet build

1.4.0

  • Draw pop-up when achievement is unlocked
  • Sync all stats and unlocked achievements to Steam when game loads
  • Fix achievements and stats menus so they load new data when opened

1.3.1

  • Display stats and achievements in sub-menus on the title screen.
  • Fix scoreboard text wrapping using upstream text wrapping improvements.

1.3.0

  • New background music: each of the four chapters has a new medley of songs
  • Positional audio for sound effects based on where the character is on the screen

1.2.1

  • Fix bug causing walk backward achievements to trigger prematurely.

1.2.0

  • Add achievements and stats, with support for syncing to Steam.
  • Store player's fullscreen and sound preferences, and re-apply them when opening the game.
  • Create a test program for the Linux version which auto loads and plays the game and checks key output and results.
  • Implement CLI, allowing for config JSON to be passed on the command line.

1.1.4

  • Check save file format before loading to prevent the game from crashing from a corrupted save file

1.1.3

  • Disable logging by default (performance gain in some web browsers from removed glGetError calls)

1.1.2

  • Draw version string on pause menu
  • Enable vsync

1.1.1

  • Add Python script for releasing tagged builds as distributables
  • Add Itch.io build
  • Bug fix: replace the removed "arcade coin" key with the bank vector

1.1.0

  • added coin bank to HUD
  • coin status saves per level instead of just as a total count of coins
  • coin displays over the player's head after it is grabbed until it is collected

1.0.4

  • add options sub-menu to title screen: bgm, sfx, fullscreen, and exit
  • hide UI when gamepad is in use, enable when mouse is in use
  • indicate selected UI button using hue rotation animation
  • support for gamepad hat
  • support for disconnecting and reconnecting gamepads
  • sanitize collected data in WASM build and write files per session
  • add function for finding the closest UI button in a given direction
  • bug fix: prevent character from moving when level loads or play is resumed from the pause menu
  • bug fix: cancel character walking sfx when paused

Contact

Contact me with questions or raise an issue on the repository page. Documentation or any other pull requests are welcome 🙂

Method Contact information
E-mail cocktail.frank@dank.game
Web https://dank.game
X https://x.com/diskmem
PayPal https://paypal.me/ohsqueezy