This project is a classic Space Invaders clone developed in C++ as a university project. It runs entirely in the console and uses ASCII characters to render the game's graphics. The game faithfully recreates the core mechanics of the original arcade classic, where the player controls a spaceship to defend against waves of descending aliens.
- Classic Gameplay: Experience the timeless gameplay of Space Invaders, with waves of enemies moving horizontally and progressively downward.
- Player Control: Maneuver your spaceship left and right to dodge enemy projectiles and position yourself for the perfect shot.
- Scoring System: Earn points for every enemy you destroy. Different types of enemies award different scores.
- Multiple Enemy Types: Face off against different alien types, each with its own unique appearance.
- Persistent Leaderboard: Your high scores are saved to a leaderboard, so you can compete with your friends and track your progress.
- Customizable Spaceships: Choose from a variety of spaceship designs to personalize your gaming experience.
- Power-ups and Special Events: Look out for the special flying saucer that appears occasionally, shooting it down will grant you bonus points.
- Game Modifiers: Customize your gameplay with options like "Insane Mode" for a more challenging experience.
- Save/Load Functionality: Save your game progress and load it later to continue your session.
- Start a New Game: From the main menu, select "New Game" and enter your name.
- Choose Your Spaceship: Select your preferred spaceship design.
- Controls:
AorLeft Arrow: Move the spaceship left.DorRight Arrow: Move the spaceship right.Spacebar: Shoot a bullet.P: Pause the game.
- Objective: Shoot down all the aliens in each wave before they reach the bottom of the screen.
- Lives: You start with a set number of lives. You lose a life if you get hit by an enemy bullet.
- Game Over: The game ends when you lose all your lives or when the aliens reach the bottom of the screen.
(GIF of gameplay will be inserted here)
- A C++ compiler (like G++)
- Windows operating system (due to the use of Windows-specific libraries like
<conio.h>and<windows.h>)
- Clone the repository:
git clone https://github.com/your-username/your-repository-name.git
- Navigate to the project directory:
cd your-repository-name - Compile the source code:
g++ -o "Space Invaders" main.cpp src/Console.cpp src/Menu.cpp -lwinmm - Run the executable:
./"Space Invaders"
.
โโโ main.cpp
โโโ src
โโโ Console.cpp
โโโ Console.h
โโโ Disk.h
โโโ Enemy.h
โโโ File.h
โโโ Files
โ โโโ leaderboard.txt
โโโ Game.h
โโโ Grid.h
โโโ Leaderboard.h
โโโ Load.h
โโโ Menu.cpp
โโโ Menu.h
โโโ Pause.h
โโโ player.h
main.cpp: The entry point of the application. It initializes the console and starts the main menu loop.src/Console.h&src/Console.cpp: These files manage all the console-related functionalities like drawing on the screen, handling colors, and managing the cursor.src/Game.h: This header file contains the main game loop, logic for collision detection, player movement, shooting, and the end-game menu.src/Menu.h&src/Menu.cpp: These files are responsible for displaying and handling interactions with all the game's menus, including the main menu, options screen, and spaceship selection.src/Enemy.h: This file defines the behavior of the enemy aliens, including their movement patterns and attack logic.src/player.h: Defines thePlayerstructure, which holds all the relevant data for the player, such as score, lives, and level.src/Grid.h: Manages the game's grid system, where all game objects (player, enemies, bullets) are placed and rendered.src/Leaderboard.h: Contains the logic for reading, sorting, and displaying the high scores from the leaderboard file.src/Files/leaderboard.txt: A text file that stores the player's name, score, and other game statistics for the leaderboard.
Contributions are welcome! If you have any ideas, suggestions, or bug fixes, please open an issue or submit a pull request. Google Search Suggestions Display of Search Suggestions is required when using Grounding with Google Search. Learn more Google logo
