
Cosmic Survivor
A downloadable game
Cosmic Survivor
Cosmic Survivor is a fast-paced arcade survival game where every second counts. Navigate your lone pixel through an increasingly hostile cosmic void, dodging relentless enemies while collecting valuable coins to boost your score.
Gameplay
Control your pixel with smooth keyboard movements as waves of enemies spawn and pursue you across the screen. The longer you survive, the more challenging it becomes—enemy spawn rates increase and movement patterns evolve to test your reflexes and strategic thinking. Collect glowing coins scattered throughout the playfield to rack up points and climb the leaderboard.
Features
- Intuitive Controls: Responsive keyboard-based movement (arrow keys or WASD) for precise navigation
- Progressive Difficulty: Dynamic enemy spawning that adapts to your survival time
- Save System: Your progress is automatically saved, allowing you to continue your quest for high scores across sessions
- Minimalist Design: Clean pixel art aesthetic that keeps the focus on pure, addictive gameplay
- Linux Native: Optimized for Linux systems with easy installation
Installation
Cosmic Survivor is distributed as a .deb package for seamless installation on Debian-based Linux distributions (Ubuntu, Mint, Pop!_OS, and more).
Simply download the package and install:
bash
sudo dpkg -i cosmic-survivor.deb
How long can you survive in the cosmic void?


Cosmic Survivor - Developer Documentation
Version: 1.0.0 Developer: Mindblade16 Engine: Built from scratch using SDL2 (no game engine)
About This Project
Cosmic Survivor is a low-level game built entirely in C using SDL2 libraries, without relying on any game engine. This project demonstrates fundamental game development concepts including collision detection, game state management, persistent data storage, and real-time rendering.
Technology Stack
- Language: C
- Graphics & Input: SDL2
- Text Rendering: SDL2_ttf
- Platform: Linux (Native)
Game Architecture
Core Systems
Game States
- Intro screen with story presentation
- Active gameplay with wave-based progression
- Win/lose conditions with appropriate endings
- High score name entry system
- Persistent leaderboard
- Credits screen
Gameplay Mechanics
- Real-time collision detection
- Delta-time based movement for frame-rate independence
- Progressive difficulty scaling across 5 waves
- Power-up system with timed effects (shields, speed boosts)
- Persistent leaderboard stored in binary format
Enemy AI
- Bouncing movement patterns
- Speed scaling based on wave number
- Dynamic spawning system
Building from Source
Prerequisites
sudo apt install build-essential libsdl2-dev libsdl2-ttf-dev
Compilation
gcc game.c -o cosmic_survivor -lSDL2 -lSDL2_ttf -lm
Running
./cosmic_survivor
Distribution Formats
Debian Package (.deb)
A packaging script is included for creating Debian packages:
chmod +x package.sh ./package.sh
This generates cosmic-survivor.deb which can be installed on Debian-based systems:
sudo dpkg -i cosmic-survivor.deb
Flatpak
The game is available as a Flatpak for universal Linux distribution through Flathub.
Building the Flatpak:
flatpak-builder --force-clean build-dir io.github.mindblade16.CosmicSurvivor.json flatpak-builder --user --install --force-clean build-dir io.github.mindblade16.CosmicSurvivor.json
Running:
flatpak run io.github.mindblade16.CosmicSurvivor
Game Features
Story-Driven Gameplay
- Beginning: Earth's core destabilizes, threatening the planet
- Middle: Survive 5 progressively difficult waves
- End: Either save Earth (victory) or witness its collapse (defeat)
Win/Lose Conditions
- Victory: Complete all 5 waves
- Defeat: Lose all 3 lives
Collectibles & Power-ups
- Gold Coins: +100 points, track progress toward victory
- Blue Shields: 5 seconds of invincibility, destroy enemies on contact
- Purple Speed Boosts: Increased movement speed for 5 seconds
Scoring System
- Coins collected: +100 points
- Power-ups collected: +50 points
- Enemies defeated with shield: +50 points
- Wave completion: +200 points
Persistent Leaderboard
- Stores top 5 scores locally in
cosmic_survivor_scores.dat - Automatic high score detection
- Player name entry (3-15 characters)
- Survives across game sessions
Controls
- WASD / Arrow Keys: Player movement
- SPACE: Start game (from intro)
- L: View leaderboard
- C: View credits
- R: Restart (from game over/victory)
- ESC: Quit game / Return to menu
- ENTER: Submit name (high score entry)
- BACKSPACE: Delete character (name entry)
Technical Implementation Details
Collision Detection
Simple circle-based collision using distance calculation between entity centers.
Frame Rate Management
- Delta time calculation for consistent movement speed
- 60 FPS target with
SDL_Delay(16) - Frame-rate independent physics
Data Persistence
Leaderboard data is stored in binary format using C file I/O operations (fread/fwrite).
Memory Management
All game objects use static arrays with fixed maximum sizes to avoid dynamic memory allocation complexity.
File Structure
cosmic-survivor-project/ ├── game.c # Main game source ├── package.sh # Debian package builder ├── io.github.mindblade16.CosmicSurvivor.json # Flatpak manifest ├── io.github.mindblade16.CosmicSurvivor.desktop # Desktop entry ├── io.github.mindblade16.CosmicSurvivor.metainfo.xml # AppStream metadata └── icon.png # Game icon (64x64)
Development Philosophy
This game was built as a learning project to understand:
- Low-level game development without engines
- SDL2 library usage for graphics and input
- Game state management
- Collision detection algorithms
- Persistent data storage
- Linux application packaging and distribution
The goal was to create a complete, publishable game from first principles, demonstrating that complex game features (enemies, collectibles, progression systems, leaderboards) can be implemented without high-level game engines.
Future Enhancement Ideas
- Sound effects and background music (SDL2_mixer)
- Additional enemy types with unique behaviors
- Boss battles at the end of each wave
- Multiple difficulty modes
- Particle effects for collisions
- Screen shake and visual feedback
- More power-up varieties
- Online leaderboard system
- Gamepad support
Credits
Game Design & Programming: Mindblade16 Built with: SDL2 - Simple DirectMedia Layer Font: DejaVu Sans (system font)
License
[MIT]
Contributing
This project was built as a learning exercise and personal project. If you'd like to fork or modify the code, please provide attribution to the original developer.
Cosmic Survivor - A low-level game development project demonstrating C programming and SDL2 capabilities
| Published | 20 days ago |
| Status | Released |
| Author | Mindblade16 |
| Genre | Action |
| Tags | 2D |
Download
Click download now to get access to the following files:
Development log
- MIT License19 days ago

Leave a comment
Log in with itch.io to leave a comment.