My first game project! A basic survival shooter where you defend against waves of enemies. This was created as a learning project to explore game development with Raylib.
In PixelSurvivor, you control a character at the bottom of the screen defending against falling enemies. Shoot them down before they reach you! As you progress through levels, more enemies appear and the challenge increases.
- Arrow Keys or A/D Keys: Move left and right
- Spacebar or Left Mouse Click: Shoot
- R Key: Reload your weapon Or it will automatically reloads when magazine are empty
- P or ESC: Pause the game
Textures & Music: by Dhanush U S - GitHub Profile
This project was built to learn Raylib, a simple and easy-to-use game programming library written in C. Through this project, I got experience with:
- Game loop architecture
- Collision detection using circle-based hitboxes
- State management (Menu, Playing, Paused, Game Over)
- Asset loading and rendering
- Audio playback and sound effects
- Basic game mechanics (shooting, scoring, lives)
- Language: C
- Library: Raylib - A simple and easy-to-use library to enjoy videogames programming
- Tools: MinGW (GCC), Make
- MinGW-w64 with GCC compiler (Download here)
- Make sure
mingw32-make.exeis in your system PATH
- Clone this repository
- Open a terminal in the project directory
- Run the build command:
mingw32-make.exe PROJECT_NAME=PixelSurvivor OBJS=PixelSurvivor.c
- Run the game:
PixelSurvivor.exe
Alternatively, open the project in VS Code and press Ctrl+Shift+B to build.
PixelSurvivor/
├── PixelSurvivor.c # Main game code (~370 lines)
├── Makefile # Build configuration
├── raylib-lib/ # Raylib library
│ └── src/
└── resources/ # Game assets
├── images/ # Character, enemy, bullet sprites
└── audio/ # Sound effects and background music
- Game States: Implemented using an enum to handle Menu, Playing, Paused, and GameOver states
- Object Pooling: Used fixed-size arrays for bullets and enemies
- Collision Detection: Simple circle-circle collision for bullet-enemy interactions
- Scaling System: Level progression scales enemy count based on kills (quadratic growth)
See LICENSE file for details.
- The game requires all resource files (images and audio) to be in the
resources/folder - If you move the raylib library, update the
RAYLIB_PATHin the Makefile