Inspiration

We wanted to create a game that combined strategic thinking with real physics. Classic artillery games like Worms and Forts are fun, but we asked, what if we could combine them with humanity's greatest creation: Angry Birds: Space? A revolutionary game where gravity wasn't just an obstacle, but a weapon? The result is a turn-based strategy game where you orbit planets, build defenses, and use gravitational slingshots to rain destruction on your opponent.

What it does

Stellar Spite is a turn-based space artillery game where two players (or you vs. AI) compete to destroy each other's base planet. Each turn, you:

  • Earn resources (metal and energy) from your planet and buildings
  • Construct orbital defenses: turrets, shields, factories, and mines
  • Fire projectiles that curve around planets using realistic gravity physics
  • Strategize to manage limited ammo and energy while predicting orbital trajectories

Victory comes from destroying the enemy base. The AI opponent uses smart targeting and fires realistic, accurate shots each turn, making it a genuine challenge.

How we built it

  • TypeScript + PixiJS v8: For performant 2D rendering and smooth animations
  • Custom Physics Engine: Implemented Newtonian gravity simulation with \(F = G\frac{m_1m_2}{r^2}\) to calculate gravitational forces between projectiles and planets
  • AI System: Built a priority-based decision engine that evaluates building placement, resource management, and trajectory calculations. The AI simulates projectile paths to avoid hitting its own base and targets enemy structures intelligently
  • Turn-Based Architecture: Designed a state machine to handle player turns, resource generation, and win conditions
  • Vite Build Pipeline: Fast development with hot module replacement and optimized production builds
  • Vercel Deployment: Continuous deployment from GitHub with custom domain configuration

Challenges we ran to

  1. Gravity Physics: Getting the trajectory simulation right was tricky. We had to balance realism with gameplay - too realistic and shots take forever, too simple and it's not interesting. We settled on scaled gravity constants and frame-limited simulations.

  2. AI Behavior: Our initial AI was too passive (single shots, low fire rate). We rewrote it to fire multiple shots per turn (~40% of available ammo) and added collision detection so it wouldn't accidentally shoot its own base planet.

  3. Performance Optimization: With hundreds of projectiles, gravity calculations, and sprite updates, we hit framerate issues—solution: object pooling for projectiles, spatial partitioning for collision detection, and optimized render loops.

  4. Deployment Drama: Vercel deployment initially failed with 1126 ESLint formatting errors (single quotes vs. double quotes, spacing issues). We removed linting from the build pipeline to deploy successfully

What we learned

  • Physics simulation is harder than it looks - balancing accuracy with performance and fun gameplay
  • AI development requires iteration - our first AI was boring, many were too aggressive, the final iteration finally felt right
  • TypeScript saved us countless debugging hours with type safety
  • Balancing goals with time constraints - we had a big vision and equally big goals for this project, and we ultimately had to balance what we could accomplish in the given time frame while still making a fun and intuitive experience - we cut features like multiplayer networking and modular building to focus on polish

What's next

  • Online multiplayer with WebSocket synchronization
  • More building types: laser arrays, repair drones, stealth shields
  • Modular Building allowing for truly fun strategic base building and physics-based destruction simulations
  • Astrophysics Realism: better orbits, moving celestial bodies, random events, etc.

Built With

Share this project:

Updates