PetPal is a virtual-pet game for macOS, written in C++17 with SFML 2. You pick an avocado or a ghost, adult or baby, and keep it fed, clean, rested, and clever. You earn coins in a box-catching game, buy food, and raise IQ in a math game. The game saves to pet_stats.txt as you play.
brew install sfml@2You also need the Xcode command line tools (xcode-select --install) and python3.
make
./build/PetpalRun the game from the repository root. It loads assets/ by relative path and writes pet_stats.txt to the working directory. make run builds and runs it the same way.
make check # everything below, in order
make test # unit tests in tests/unit
make pin # replays scripted play and compares every frame with tests/golden
make check-assets # every asset the code names is tracked, and every tracked asset is used
make lint # structural rules in tests/lint.pytests/pin/README.md explains the pin and how to update its goldens after an intended change.
src/main.cppopens the main window and runs the menu, the pet picker, and the home screen.src/catalog.cppandsrc/catalog.hhold everything that differs between the four pets as aPetSpectable, plus each species' sound and quotes.src/scene.hscales the 1920x1080 scene to any window size and maps clicks back into it.src/scenes/has one file per window: start menu, pet picker, home, shop, fridge, and info.food_icons.cpplays out the food grid the shop and fridge share and finds the food under a click.src/minigames/has the box-catching game (boxes.cpp) and the math game (math.cpp).src/stats.cppholds the stats and their decay.src/save.cppreads and writes the save file.src/anim.cppplays a sprite sheet.src/quote.cpppicks and shows the pet's quotes.assets/holds every image, font, and sound.tests/unit/,tests/pin/, andtests/golden/hold the unit tests, the pin, and its goldens.tests/check_assets.pyandtests/lint.pyare the asset check and the lint..claude/skills/verify/tells a coding agent how to prove a change in the running game.