2.5 KiB
2.5 KiB
AGENTS.md
Quick build and run
- Build:
make– compilesmain.cwith GCC and links the local raylib libraries. The output isstars.exein the project root. - Run:
make run– builds (if needed) and executesstars.exe. - Clean:
make clean– removesstars.exe.
Environment requirements
- Windows (the default). The Makefile uses the
delcommand and links against Windows system libraries (opengl32,gdi32,winmm). On Unix/macOS the makefile would need adjustment. - GCC and GNU Make must be on the PATH.
Assets and dependencies
- All assets (sound files) live under
sounds/. The program loads them from the current working directory. - The local Raylib binaries are in the
lib/directory (libraylib.dll,libraylib.a,libraylibdll.a). No external installation of Raylib is required. - Header for the library is in
include/. The compiler flags-Iincludeand-Llibpoint to these.
Game controls
- Movement: Arrow keys (UP/DOWN/LEFT/RIGHT)
- Shooting: SPACEBAR
- Restart game: Press SPACE during game over screen
Common pitfalls
- Running
makefrom PowerShell may fail because the Makefile usesdel. Use a plain CMD window or modify the Makefile to usedel /qonly in CMD. - If you see linker errors about missing
opengl32etc., ensure your GCC toolchain is installed correctly. - Game uses hardcoded screen dimensions (800x450) and enemy counts (5 for level 1, 10 for level 2).
How to extend
- Only one source file (
main.c) is present. Adding new modules should follow the same include / lib pattern. - To add a new build target, append a rule to the Makefile.
Game mechanics
- Player has 100 HP (health points)
- Enemies have 50 HP each
- Shooting requires cooldown between bullets (0.1 seconds)
- Game has 3 levels with increasing enemy counts
- Enemies move in a wave pattern from top of screen
- Different color enemies represent different levels:
- Green: Level 1
- Blue: Level 2
- Yellow: Level 3 (final boss level with 15 enemies)
Build troubleshooting
If you encounter compilation or linking errors, ensure:
- You're in the project root directory when running
make - Your MinGW installation has proper support for Windows libraries
- Use either
mingw32-makeormakefrom a proper MinGW terminal (not PowerShell) - You may need to adjust your Makefile for your specific MinGW setup
For manual compilation issues on Windows:
gcc -Iinclude -Llib -lraylib -lopengl32 -lgdi32 -lwinmm -o stars.exe main.c