Skip to content

A simple Space Shooter game coded and designed in C++ language in SFML graphics mode.

License

Notifications You must be signed in to change notification settings

Zer0-Bug/ArcadeSpaceShooter_SFML

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Space Shooter: SFML Multimedia Experience

C++ SFML Visual Studio License

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.

° ° ° °



Technical Architecture

This implementation transitions from procedural logic to a robust Object-Oriented Architecture, utilizing SFML's specialized modules for performance and asset management:

  1. Modular Entities: Employs discrete classes for Player, Enemy, and Bullet, each encapsulating its own state, textures, and transformations.
  2. Asset Pipeline: Implements a centralized loading system for high-resolution .png textures and .ttf typography, ensuring efficient memory usage via pointer-based texture sharing.
  3. Collision System: Leverages SFML’s FloatRect intersection logic for high-precision AABB collision detection between game entities.
  4. Framerate Orchestration: Features a synchronized game loop with a capped 15Hz logic-tick to maintain consistent gameplay physics across different hardware configurations.


Project Structure

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


Game Mechanics

  • 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.

Player Controls

Action Key
Thrust Up W
Thrust Down S
Deploy Weapon Space


Technical Specifications

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


Deployment & Installation

1. Environment Setup

Ensure you have a C++ compiler installed (GCC or MSVC) and the SFML developer headers corresponding to version 2.6.1.

2. Acquisition

git clone https://github.com/Zer0-Bug/ArcadeSpaceShooter_SFML.git
cd ArcadeSpaceShooter_SFML

3. Download SFML Library

The SFML library must be installed on your system. You can download it from here.

4. Compilation (GCC/Linux/MingW)

Ensure the SFML library paths are correctly linked in your environment:

g++ SFML/SpaceShooter.cpp -o space-shooter -lsfml-graphics -lsfml-window -lsfml-system

5. Running the Game

Execute 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-shooter


Contribution

Contributions 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:

  1. Fork the repository.
  2. Create a new branch for your change:
    git checkout -b feature/your-feature-name
  3. Commit your changes with a clear and descriptive message:
    git commit -m "Add: brief description of the change"
  4. Push your branch to your fork:
    git push origin feature/your-feature-name
  5. 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.

Email × LinkedIn


Releases

No releases published

Packages

No packages published