- C++ 96.2%
- C 2.7%
- CMake 1.1%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| src | ||
| test | ||
| .gitignore | ||
| CMakeLists.txt | ||
| LICENSE | ||
| platformio.ini | ||
| README.md | ||
Mossling
Mossling is a tiny forest-spirit game for the Bonkgotchi Revision 4 ESP32-S3 board. A seed wakes beneath the memory LCD, develops a personality from the way it is cared for, and eventually blooms.
This is a virtual pet, but not a guilt machine. Neglect can make a Mossling wilting or pensive; it cannot die. Coming back and saying hello is always a useful thing to do.
The small things you can do
- Dew restores thirst.
- Chase is a 15-second game: move through the garden and catch bright motes. Select ends the game early.
- Hum asks you to echo a four-note directional phrase. Every direction is also a note.
- Tuck puts the Mossling to sleep. Select wakes it again.
- Tilt the device and it leans and looks around.
- Shake the device to wake it and scatter an invigorating spore burst.
- Press up or down from home to see the journal; any button returns.
Care gradually shapes a Mossling into a verdant, bright, melodic, or dreamy nature. Its four life stages are seed, sprout, mossling, and bloom. State is stored in ESP32 NVS and persists across emulator runs when an NVS file is used.
The RGB LED is an ambient aura rather than required UI: blue for dew, violet for play, cool blue for songs, dim indigo for sleep, and a mood color while idle. The game remains fully readable if the physical LED is unavailable.
Run in esp32-emu
From the sibling esp32-emu checkout:
bin/esp32-emu build --firmware-dir ../mossling
bin/esp32-emu play --out runs/mossling --nvs-file runs/mossling-nvs.json
Then open http://127.0.0.1:8000/. Arrow keys are the joystick; Enter or Space is Select. The playground's accelerometer panel drives the same tilt and shake paths as the physical sensor.
A short scripted tour is included:
bin/esp32-emu run --firmware-dir ../mossling \
--out runs/mossling-tour \
--script ../mossling/test/scripts/tour.json \
--duration 9000
bin/esp32-emu serve --run-dir runs/mossling-tour
Build for the board
The PlatformIO environment matches the existing Revision 4 firmware setup:
pio run
pio run -t upload
pio device monitor
Test the game rules
The care model has no Arduino dependency, so its persistence validation, stat changes, personalities, sleep behavior, and growth rules can be tested as a normal host program:
cmake -S . -B build
cmake --build build
ctest --test-dir build --output-on-failure
Project shape
src/GameModel.*is the portable, deterministic pet simulation.src/Main.cppcontains the display, input, mini-games, persistence, and orchestration layer.src/Accelerometer.*,AuraLed.*, andSound.*are narrow drivers for the board's playful bits.test/game_model_test.cppverifies the simulation without hardware.
Mossling is MIT licensed. The display dependencies retain their respective upstream licenses when fetched by PlatformIO or supplied by the emulator.