A retro-style game built with Raylib and compiled to WebAssembly for web deployment.
- Web-based gameplay (runs in browser via WebAssembly)
- Simple keyboard controls
- Scoreboard tracking
- Retro aesthetic
- Emscripten SDK (emcc compiler)
- Node.js/pnpm (for serving)
# Build the game
make build
# Build and serve locally
make serve
The build process compiles the C source code to trash.html
using Emscripten, creating a complete web-based game.
- Arrow Keys: Navigate menu options
- Enter: Select menu item
- ESC: Exit (when window close is triggered)
src/
- C99 source codemain.c
- Entry point and game loopmenu.h/c
- Menu system implementationgame.h
- Core game logic
raylib/
- Raylib framework and dependenciesMakefile
- Build configuration
- Language: C99
- Graphics: Raylib
- Build: Emscripten (WebAssembly)
- Deployment: Web browser
The game follows C99 standards.
- Includes: Raylib relative path
../raylib/raylib.h
, local headers with quotes - Formatting: 4-space indentation, K&R brace style
- Error handling: Simple return codes, no exceptions (web target compatibility)
- Memory: Stack allocation preferred, RAII patterns
- Comments: Avoid unless documenting complex logic