Skip to content

🚀 Space Invaders Game- This is a simple implementation of the classic Space Invaders game using C++ and the SDL2 library.

Notifications You must be signed in to change notification settings

Ajoy10/Space-invaders-SDL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Space Invaders Game

This is a simple implementation of the classic Space Invaders game using C++ and the SDL2 library. The purpose of this project is to provide a fun way to practice C++ programming and familiarize myself with game development concepts.

💻 Getting Started

Using Visual Studio

  1. Clone the repository or download the source code files.
  2. Open the Space Invaders project folder in Visual Studio.
  3. Make sure you have the SDL2 libraries installed on your system.
  4. In Visual Studio, go to Project > Properties.
  5. In the project properties, go to Configuration Properties > VC++ Directories.
  6. Edit the Include Directories and Library Directories to specify the paths to your SDL2 installation.
  7. Build the project by pressing Ctrl+Shift+B or selecting Build > Build Solution.
  8. Run the game by pressing Ctrl+F5 or selecting Debug > Start Without Debugging.

Manual Compilation

If you prefer to compile the project manually, follow these steps:

  1. Clone the repository or download the source code files.

  2. Make sure you have the SDL2 libraries installed on your system.

  3. Open a terminal or command prompt and navigate to the project directory.

  4. Compile the source code using the following command:

    g++ main.cpp -o space_invaders -lSDL2 -lSDL2_image

    If you are using a different compiler, adjust the command accordingly.

  5. Run the game:

    ./space_invaders

🎮 Gameplay

The objective of Space Invaders is to destroy a fleet of aliens while avoiding their projectiles and preventing the aliens from reaching the bottom of the screen. sad

  • Move the spaceship using the A and D keys or the Left and Right arrows.
  • Shoot by pressing the spacebar.
  • Destroy all aliens to win the game.
  • If any alien reaches the bottom of the screen or collides with the spaceship, the game is over.

⏳ Progress

Two enemies on screen bouncing horizontally and player character moving with input

📚 Resources

🙌 Credits

📄 License

This project is licensed under the MIT License. Feel free to use and modify the code for personal or educational purposes.

About

🚀 Space Invaders Game- This is a simple implementation of the classic Space Invaders game using C++ and the SDL2 library.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages