A high-performance 2D Space Shooter built with C++ and the SFML 2.6.1 framework. Featuring an object-oriented design, hardware-accelerated sprite rendering, and precise collision detection, this project delivers a polished arcade experience with high-resolution assets.
This implementation transitions from procedural logic to a robust Object-Oriented Architecture, utilizing SFML's specialized modules for performance and asset management:
- Modular Entities: Employs discrete classes for
Player,Enemy, andBullet, each encapsulating its own state, textures, and transformations. - Asset Pipeline: Implements a centralized loading system for high-resolution
.pngtextures and.ttftypography, ensuring efficient memory usage via pointer-based texture sharing. - Collision System: Leverages SFML’s
FloatRectintersection logic for high-precision AABB collision detection between game entities. - Framerate Orchestration: Features a synchronized game loop with a capped 15Hz logic-tick to maintain consistent gameplay physics across different hardware configurations.
ArcadeSpaceShooter_SFML/
├── LICENSE # MIT License
├── README.md # Project documentation
│
├── SFML/ # Source Code & Assets
│ ├── SpaceShooter.cpp # OO Game Implementation
│ ├── player.png / enemy.png # High-res sprites
│ ├── bullet.png / background.jpg # Game assets
│ ├── arial.ttf # UI Typography
│ └── SpaceShooter.sln # Visual Studio Solution
│
├── SFML-2.6.1/ # SFML Framework binaries
│ ├── bin/ # Runtime DLLs
│ ├── include/ # Header headers
│ └── lib/ # Static libraries
│
└── SFML_Screenshots/ # Gameplay visual previews
- Sprite-Based Navigation: Vertical player movement mapped to low-latency input.
- Rapid Fire System: Timer-controlled projectile firing with dynamic vector storage.
- Enemy Swarm Logic: Randomized spawn vectors and horizontal translation towards the player.
- Fail-State Logic: Integrated collision triggers that monitor both health depletion and boundary breaches.
- Layered HUD: Real-time rendering of Cyan-colored scores and health status via binary categorization.
| Action | Key |
|---|---|
| Thrust Up | W |
| Thrust Down | S |
| Deploy Weapon | Space |
| Component | Specification |
|---|---|
| Paradigm | Object-Oriented Programming (OOP) |
| Graphics Library | SFML 2.6.1 (Simple and Fast Multimedia Library) |
| Logic Tick | 15 FPS Limit (Configurable) |
| Rendering | 800x600 Hardware-Accelerated Viewport |
| Assets | Alpha-blended PNGs / JPEGs / TTF Font |
Ensure you have a C++ compiler installed (GCC or MSVC) and the SFML developer headers corresponding to version 2.6.1.
git clone https://github.com/Zer0-Bug/ArcadeSpaceShooter_SFML.gitcd ArcadeSpaceShooter_SFMLThe SFML library must be installed on your system. You can download it from here.
Ensure the SFML library paths are correctly linked in your environment:
g++ SFML/SpaceShooter.cpp -o space-shooter -lsfml-graphics -lsfml-window -lsfml-systemExecute the binary. Note: The external DLLs in SFML-2.6.1/bin may need to be in the same directory as the executable on Windows.
./space-shooterContributions are always appreciated. Open-source projects grow through collaboration, and any improvement—whether a bug fix, new feature, documentation update, or suggestion—is valuable.
To contribute, please follow the steps below:
- Fork the repository.
- Create a new branch for your change:
git checkout -b feature/your-feature-name - Commit your changes with a clear and descriptive message:
git commit -m "Add: brief description of the change" - Push your branch to your fork:
git push origin feature/your-feature-name - Open a Pull Request describing the changes made.
All contributions are reviewed before being merged. Please ensure that your changes follow the existing code style and include relevant documentation or tests where applicable.
∞