Loading repository data…
Loading repository data…
kleinpanic / repository
QuantumStriker is a high-performance 2D space shooter written in C using SDL2. Pilot your futuristic spaceship through a dynamic, galactic environment with adaptive difficulty and community high scores. Enjoy responsive controls and endless challenges as you climb the leaderboard!
If you want to enjoy this game and submit your high score, please be aware that it may be lost due to future updates. If anyone besides myself is ever to play this game and contribute a score, I will try to develop a fully compatible mechanism so that past blockchain entries remain valid under future versions. I will save your score and do my best to ensure it is preserved for future iterations, but I cannot make that a guarantee.
| Rank | Username | Score | Timestamp |
|---|---|---|---|
| 1 | kleinpanicDevAI | 84700 | 2025-03-28 18:34:09 |
| 2 | kleinpanic | 2585 | 2025-03-26 16:02:08 |
No cheaters found.
QuantumStriker is a high-performance 2D space shooter written in C (using SDL2, SDL2_ttf, and SDL2_gfx). You pilot a futuristic spacecraft through a dynamically generated galactic environment, fending off waves of enemies that scale in difficulty as your score rises. When your ship is destroyed, your final score is recorded in a blockchain-based high score system that validates each entry via cryptographic proof-of-work and digital signatures. Invalid or tampered scores (failing verification) are flagged as cheaters and listed separately in the repository README.
Dynamic Galactic Environment:
Explore a procedurally generated universe filled with stars, planets, and cosmic pickups. The background is populated randomly and scrolls as you fly, giving a sense of vast space.
Adaptive Difficulty & Advanced AI:
As your score grows, enemy spawn rates accelerate and AI behaviors become more challenging. Early on, you face simple drones, but as you progress, advanced enemy types (e.g., shooter, tank, fast, stealth, boss) appear. Shooter enemies maintain a strategic distance and fire at you with slight aim randomness for realism. Boss enemies have higher health and unique movement patterns to test your skills.
Dynamic Ship Sizing:
Change your ship’s size on the fly. Use UP to increase and DOWN to decrease your ship’s scale, affecting hitbox and firing spread. Press Right Shift to reset to the default size. This feature adds a tactical layer—larger ships can hit more targets but are easier to hit, while smaller ships are nimble but do less damage.
Blockchain-Backed High Scores:
After each game over, input a username to submit your score. The game creates a new block in highscore/blockchain.txt containing your username, score, timestamp, proof-of-work hash, and a digital signature. Proof-of-work ensures the score is computationally earned (by finding a hash with a required number of leading zeros), and the RSA signature (using your unique key) ties the block to you. A Python script, verify_scores.py, recomputes each block’s hash and checks the proof-of-work and signature to validate authenticity. Verified scores show up in Top Scores, whereas any block failing verification is listed under Cheaters.
New Visual Effects (v0.1.9):
--fullscreen flag) using your desktop’s resolution, or in a resizable window. The rendering system adapts to the current screen dimensions dynamically.shakeTimer and shakeMagnitude to offset the camera’s position for a few frames, then settles.For a deeper technical breakdown, see ARCHITECTURE.md. For development guidelines, refer to CONTRIBUTING.md.
Ensure you have the following installed on your system:
On Debian/Ubuntu, you can install these via apt:
sudo apt-get install build-essential libsdl2-dev libsdl2-ttf-dev libsdl2-gfx-dev libssl-dev
(libssl-dev provides OpenSSL development libraries.)
Clone the repository and navigate into it:
git clone https://github.com/yourusername/QuantumStriker.git
cd QuantumStriker
Compile the game using the provided Makefile:
make
This produces an executable named QuantumStriker. To include debug symbols and verbose logging, build in debug mode:
make debug
This defines debug flags and disables optimizations for easier debugging.
Run the game from the terminal:
./QuantumStriker
Use the controls described above to play. Close the game window or press Esc to exit.
You can modify the game’s behavior with these optional flags:
--version: Print the game version and exit.--help: Show a brief help text with usage and flags.--debug: Enable debug mode (console logging). By default, only critical errors log; with this flag, detailed logs appear (movement, collisions, AI decisions, etc.). Useful for development or if reporting a bug.--fullscreen: Start in fullscreen mode at desktop resolution. (You can still toggle windowed mode by quitting and restarting without the flag.)--highscores: Print all high scores recorded in the blockchain (valid and invalid) to the console in a formatted list, then exit.Scoring: Your score increases with time survived and enemies destroyed. The current implementation awards 10 points per enemy kill plus 1 point per second of survival. The HUD (top-left) continuously displays your health, shield energy, score, and coordinates for awareness.
Enemy AI: Enemies use simple AI patterns:
The spawn algorithm introduces these types gradually: e.g., before 100 points only basics spawn; by 500 points, shooters mix in; by 1000, tanks join; by 2000+, all types including bosses can spawn. Each enemy type has preset health and sometimes unique properties (shooters have a shoot cooldown timer, stealth might have a transparency toggle, etc.).
Game Loop: The core loop runs at ~60 FPS (frame delay ~15ms) and handles:
shakeTimer=20 frames and shakeMagnitude=10) to visually indicate damage. The bullet is then removed.Automated Leaderboard Updates:
A GitHub Actions workflow runs scripts/update_highscores.py every Monday at 00:00 UTC to update the Top Scores and Cheaters sections in this README. The script reads highscore/blockchain.txt, verifies each entry, and updates the markdown table between the TOP_SCORES markers with the highest valid scores. It similarly updates the CHEATERS section if any invalid entries are detected. This ensures the online leaderboard is always current and trustable, without manual intervention.
Command-Line Flags:
QuantumStriker supports several launch options:
--version: Print the current game version.--help: Show a help message describing usage.--debug: Enable verbose debug logging (to console) for development or troubleshooting.--fullscreen: Launch in fullscreen mode. In v0.1.9 this flag is fully supported, toggling SDL_WINDOW_FULLSCREEN_DESKTOP for an immersive experience.--highscores: Display all recorded high scores in the terminal (reads from blockchain.txt and prints a formatted list).Responsive Controls:
Modular Architecture:
The game’s code is divided into modules, each handling a specific aspect:
isEnemy flag to differentiate origin.DEBUG_PRINT macros with different verbosity and color-coded output for logs. This helps trace game events and is gated by flags so it doesn’t affect performance when not needed.config.h for easy tuning. version.h holds the game’s current version string.