2D game · C++ programming
Space++
A C++ and SFML space game with a spaceship, projectiles and two meteor types. It explores object-oriented programming, collisions and the update/render loop.
Prototype
- C++
- SFML 2.6
- Make
My contribution
A felpzw project: the reviewed public history attributes commits to that profile. Project-specific logic lives in main.cpp and Game.hpp; bundled SFML libraries are third-party dependencies.
Problem
Implement a small space game to apply classes, inheritance, keyboard input and collision detection in C++.
Context and scope
The README calls the project Space++; the repository is named Space-. The code opens an 800 × 600 window, uses WASD for movement and J to fire, tracks lives and prints the score on exit. This is a code review; the game was not run.
Architecture
main.cpp processes events, spawns meteors, checks sprite bounding-box intersections and updates the scene. Game.hpp defines Player, Bullet and an abstract Meteor class with fast and slow variants.
SFML supplies the window, sprites and textures. The Makefile builds with g++ and links graphics, window and system libraries included in src/lib.
- SFML events · movement and firing
- Entities · updates and collisions
- Rendering · sprites, lives and score
Decisions and trade-offs
Inheritance differentiates meteor movement and durability. Bounding-box collisions keep the implementation compact but do not follow the visual outline of sprites.
The loop caps the frame rate at 30 frames per second and uses fixed movement per update. This simplifies the prototype but represents neither a performance measurement nor time-independent movement. These trade-offs are derived from the code.
Tests and evidence
No automated tests were found in the game-specific code. Manual validation should cover collisions, entity removal, window boundaries and shutdown when lives run out. That checklist was not executed in this review.
Limitations
The code uses pointers and manual memory management; Meteor is polymorphic but its destructor is not virtual. Animation reloads texture files during the loop, and the build depends on bundled Linux libraries.
Textures are loaded through relative paths: run from the repository root, where the images live. This snapshot provides neither an installer nor cross-platform validation.
Explore the project
Start with main.cpp, then Game.hpp to follow the entity lifecycle. Clone the indicated revision and review the Makefile with a compatible C++ compiler and SFML setup.
The README specifies make and ./main. Run from the repository root so texture files can be found. No precompiled repository binary was executed during this review.
make
./mainSources checked on 2026-09-27 · Content v1 · Revision ed594a6.