Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Space Invaders (C & SDL2) 👾

fr

A clone of the famous retro arcade game Space Invaders, developed in C using the SDL2 graphics library.

Screenshot

Features

  • Smooth ship movement (with collision detection and screen boundaries).
  • Alien swarms with progression and animation systems.
  • Shooting mechanics (player missiles and enemy bombs).
  • Destructible shields.
  • Damage and destruction animations.
  • Gamepad (Plug & Play) and keyboard support.
  • Victory and Game Over screens with an interactive menu.

Prerequisites and Installation

This project is designed to be compiled in a Linux environment. It requires the gcc compiler, make, and the SDL2 development libraries.

Installing dependencies:

Arch Linux / Manjaro:

sudo pacman -S base-devel sdl2 sdl2_ttf

Debian / Ubuntu:

sudo apt update
sudo apt install build-essential libsdl2-dev libsdl2-ttf-dev

Compilation and Execution

From the root of the project directory, run:

make clean && make

🎮 Controls

The game is playable with both a keyboard and a controller (automatically detected at launch).

Action Keyboard Controller (feature)
Move left Q Left Joystick
Move right D Right Joystick
Shoot P -
Start game S -
Main Menu M -
Quit W -

Roadmap (Future Improvements)

This project is open to customization. Here are the planned improvements:

  • Add support for popular controllers (PlayStation, Xbox, etc.).
  • Add activatable power-ups via drops (e.g., falling from defeated invaders).
  • Create an interactive menu with viewable game statistics.
  • Create a portable .AppImage for Linux.
  • Cross-compile a .exe version for Windows.
  • Add sound effects and background music (via SDL_mixer).
  • Add a scoring system with a saved High Score accessible from the menu.
  • Add different enemy types and a final boss.

📝 License

This project was developed in an academic context. Feel free to fork the repository, explore the code, and submit Pull Requests for improvements.

About

A robust Space Invaders clone in C and SDL2, developed as a first-year engineering project. Features custom memory management, cross-platform builds, and hardware controller support.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages