Development is currently on hold due to time constraints. However, plans for future updates remain in place, including new levels, a main menu, refined gameplay mechanics, and more dynamic enemy and asteroid movements to elevate the gameplay experience.
Space Crusher is a 2D space shooter game being developed from scratch using the C programming language and the SDL (Simple DirectMedia Layer) library. In this game, players control a spaceship, navigating through space while dodging asteroids and battling against various enemies.
- Spaceship movement and shooting based on player input.
- Collision detection for the spaceship, enemies, bullets, and asteroids.
- Health bar decrease upon collisions with enemy bullets.
- Sandbox level for testing and demonstration purposes.
demo.mp4
To get started with this project, follow the steps below:
-
Install build tools and SDL libraries
-
Debian/Ubuntu:
sudo apt install gcc make libsdl2-dev libsdl2-image-dev
-
Fedora/RHEL/CentOS:
sudo dnf install gcc make SDL2-devel SDL2_image-devel
-
OpenSUSE:
sudo zypper install gcc make SDL2-devel SDL2_image-devel
-
Arch Linux:
sudo pacman -S gcc make sdl2 sdl2_image
-
If your Linux distribution is not listed, you can find instructions for installing the SDL libraries from source here.
-
-
Clone the repository
git clone https://github.com/cristianscheid/space-crusher.git cd space-crusher
-
Build the project
make
-
Run the executable
./build/space-crusher
Once the game is running, you can control the spaceship using the arrow keys to move and the spacebar to shoot. To exit the game, simply close the window.
To run or debug the project with Visual Studio Code, follow these steps:
-
Open the
space-crusher
project folder in Visual Studio Code. -
Install the
C/C++
extension by Microsoft from the Extensions tab (Ctrl+Shift+X). -
Go to the Run and Debug tab (Ctrl+Shift+D).
-
Select "Debug Space Crusher" or "Run Space Crusher" from the dropdown at the top, next to the play icon.
-
Click the play icon to start. If you're debugging, remember to set breakpoints.
Special thanks to the asset creators at OpenGameArt for their contributions to this project. Below is a list of the assets used:
-
Spaceships:
-
Background:
-
Laser:
-
Explosion:
-
Asteroids:
Distributed under the MIT License. See LICENSE.txt for more information.