62 lines
2.5 KiB
Markdown
62 lines
2.5 KiB
Markdown
# AGENTS.md
|
||
|
||
## Quick build and run
|
||
|
||
- **Build**: `make` – compiles `main.c` with GCC and links the local raylib libraries. The output is `stars.exe` in the project root.
|
||
- **Run**: `make run` – builds (if needed) and executes `stars.exe`.
|
||
- **Clean**: `make clean` – removes `stars.exe`.
|
||
|
||
## Environment requirements
|
||
|
||
- **Windows** (the default). The Makefile uses the `del` command 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 `-Iinclude` and `-Llib` point to these.
|
||
|
||
## Game controls
|
||
|
||
- **Movement**: Arrow keys (UP/DOWN/LEFT/RIGHT)
|
||
- **Shooting**: SPACEBAR
|
||
- **Restart game**: Press SPACE during game over screen
|
||
|
||
## Common pitfalls
|
||
|
||
- Running `make` from PowerShell may fail because the Makefile uses `del`. Use a plain CMD window or modify the Makefile to use `del /q` only in CMD.
|
||
- If you see linker errors about missing `opengl32` etc., 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:
|
||
|
||
1. You're in the project root directory when running `make`
|
||
2. Your MinGW installation has proper support for Windows libraries
|
||
3. Use either `mingw32-make` or `make` from a proper MinGW terminal (not PowerShell)
|
||
4. You may need to adjust your Makefile for your specific MinGW setup
|
||
|
||
For manual compilation issues on Windows:
|
||
```bash
|
||
gcc -Iinclude -Llib -lraylib -lopengl32 -lgdi32 -lwinmm -o stars.exe main.c
|
||
```
|