CVZ: Cube vs Zombies is an interactive shooting game built from scratch using C and the SDL2 library. This is a fun action-packed and challenging game in which you must survive against incoming swarms of various enemies and gain as many points as you can!
We built this as a Major Project in our introduction to computer-science course (ICS-1010) in IIT Jodhpur.
-
Main Menu and Pause Menu to provide a more interactive experience.
-
Theme Music to maintain the game atmosphere.
-
Player movement using W, A, S, D keys and either of their combination for diagonal movement.
-
Collision detection with maze walls and doors.
-
Enemies with different characteristics(damage, points dropped, speed) (Zombies, Witches, Bosses).
-
Health, points and ammo system.
-
Randomly spawning treasures with claimable loot.
-
Allows Room Change, when the player reaches a certain amount of points.
-
You must have gcc/mingw installed on your system.
-
To compile and run the game, you need to have SDL2 library installed on your system. Follow the steps below:
Install SDL2: Download SDL2 library from the official website and follow the installation instructions for your platform. https://wiki.libsdl.org/SDL2/Installation
-
Clone the repository: Clone this repository to your local machine using Git: git clone <repository_url>
-
If you're facing linker issues , include sdl- mixer,ttf and image libraries within the game folder with the main.c file
-
Compile the code: Navigate to the cloned directory and compile the code using a C compiler. For example, using GCC:
Command prompt:
gcc -o CVZ main.c -lSDL2 -lSDL2_image -lSDL2_ttf
-
Run the game: After successful compilation, run the game executable:
Command prompt:
./CVZ
-
Game starts by giving player 100 ammo and 0 points initially.
-
There are 3 types of enemies : white(skeleton), purple(witch),red(boss)-> their stats and points vary from lowest to highest.
-
Press W,A,S,D for movement in up, left, down and right directions respectively. You can use their combinations for diagonal movement.
-
Use the spacebar key to shoot.
-
You'll get random treasure drops , Press 'F' to claim: It might give you some damage , health , ammo or points.
-
If you're in any room , and you need a breathing space and want to escape the enemies you can escape the room by unlocking the new one -> go at centre of any side of the screen and Press 'G' and 1000 points will be deducted from you and you'll be in another room.
-
Press the escape key to pause the game.
-
This game is an infinite shooter , so it goes on till you survive.
https://github.com/AayushBade14
- Idea of the Project
- Player Movement
- Player and enemy damage system
- Shooting system
- Game menu system
- Health system
- Screen shake system
- Random Enemy Spawning based on fixed probability
- Enemy Movement and Player Targetting System
- Doors and Unlockable Maps System
- Loot Box Spawning and Claiming System
- Defining of Collisions
- Ammo System
- Points System
- Text Rendering using ttf
- Images and Sprites Rendering and Animation.
https://github.com/shashankparchure
- Audio Rendering
- Bugs and Error Fixing
The video in the attached google drive link gives a demonstration of the game. https://drive.google.com/file/d/1NOqMKViqv-DrP7XxA6XgN50ghxJyYe_k/view?usp=drive_link