crisp-game-lib-portable-fruitjam

A port of the crisp game lib portable from abagames to the adafruit fruitjam


Project maintained by joyrider3774 Hosted on GitHub Pages — Theme by mattgraham

Adafruit’s fruitjam Version of crisp-game-lib-portable

DownloadCountTotal DownloadCountLatest LatestVersion License

This is a repo containing the adafruit’s fruitjam port of the crisp games library which is a Minimal C-lang library for creating classic arcade-like mini-games running on devices and browsers. Re-implemented version of crisp-game-lib for smaller devices. You can play sample games in your browser.

Fruitjam Controls:

Keyboard Controls:

Mouse

Adafruit’s snes gamepad controls:

Libraries / tools used or required

Credits

Notes


ORIGINAL README.MD ————————————————————————————————

Target devices

Sample game codes and reference

How to write your own game

  1. Copy game_Template.c to game[your game name].c

  2. Comment out other games in menuGameList.c and add void addGame[your game name](); and addGame[your game name]()

    ...(snip)...
    void addGameReflector();
    void addGame[your game name]();
    
    void addGames() {
      /*addGameThunder();
      ...(snip)...
      addGameReflector();*/
      addGame[your game name]();
    }
    
  3. Write your own game in game[your game name].c and rename void addGame_Template() { to void addGame[your game name]() {

  4. Build for browser and debug

  5. Once the game is complete, revert other games that were commented out in menuGameList.c and build it for other devices

Build for [target device]

M5StickCPlus, M5Stack, PyBadge

  1. Install LovyanGFX library

  2. Create cglp[target device]/ directory (e.g. cglpM5StickCPlus/)

  3. Copy cglp[target device].ino, ./src/lib/* and ./src/games/* files to the directory

  4. Verify and upload cglp[target device].ino with Arduino IDE

Playdate

  1. Copy ./src/cglpPlaydate directory

  2. Create cglpPlaydate/build directory

  3. Move to cglpPlaydate/build directory and cmake ..

  4. Open crisp-game-lib-portable.sln with Visual Studio

  5. Build the solution (see Building for the Simulator using Visual Studio)

  6. See also Building for the Playdate using NMake

Arduboy

Note: Some features are limited due to device resource limitations.

ESP32-2432S028R

ESPboy

Funkey or RG-Nano

Any Device supporting SDL1, SDL2 or SDL3

  1. (Cross)compile using provided Makefile by running make -f ./src/cglpSDL2/Makefile or make -f ./src/cglpSDL1/Makefile in rootfolder of this repo or use the CMake with the provided src/cglpSDL2/CMakelists or src/cglpSDL3/CMakelists file

  2. Checkout binary --help for information on commandline parameters

Browser

  1. Install Emscripten

  2. Run dev npm script to start the dev server and watch js files

  3. Run dev_c npm script to watch c files and build wasm files

How to operate

Back to the game selection menu

Toggle sound on/off

Key assignment on SDL Ports

Key assignment on browser

How to port the library to other devices

The source codes for library and games are written device-independent. Besides, you need to implement device-dependent code for the following functions:

Sample device-dependent codes are cglpM5StickCPlus.ino and cglpPyBadge.ino.

Porting games from crisp-game-lib using an AI chatbot

You can use an AI chatbot to port game source code for crisp-game-lib to crisp-game-lib-portable. By providing the prompt and set of files to the chatbot, you can obtain the code ported to the C language. I have tried this using Claude 3 Opus, but it is expected to work to some extent with other LLMs as well. The ported code is not perfect, so it needs to be manually checked and corrected.