~/vedant_
homeaboutthoughtsprojects
Back to all projects

TerminalTrajectory

completed
pythonphysicsterminalgame

A text-based space shooter game with realistic physics, all running in the terminal. Because who needs graphics when you have ASCII art and imagination?

What is this?

TerminalTrajectory is a text-based space shooter game that runs entirely in the terminal. It features realistic physics, particle effects, and gameplay all rendered using ASCII characters. It's my attempt to create an engaging game with minimal resources, proving that you don't need fancy graphics to have fun.

Features

  • Realistic physics simulation for projectiles and spacecraft
  • Particle effects using ASCII characters
  • Multiple enemy types with different behaviors
  • Power-ups and upgrades
  • High score tracking
  • Configurable difficulty levels
  • Color support for terminals that support it

Technical details

Built with:

  • Python for the core game logic
  • NumPy for physics calculations
  • Curses library for terminal manipulation
  • Custom ASCII art generator for visual effects
  • JSON for saving high scores and settings

The physics

The game implements a simplified 2D physics engine that handles:

  • Gravitational forces between objects
  • Collision detection and response
  • Momentum and energy conservation
  • Trajectory calculations for projectiles

Gameplay

Players control a spacecraft using keyboard commands:

  • Navigate through space avoiding obstacles and enemies
  • Shoot projectiles at enemies
  • Collect power-ups to upgrade your ship
  • Try to achieve the highest score possible

Why I built it

I've always been fascinated by physics simulations and wanted to create a game that incorporated realistic physics. The terminal-based approach was a fun challenge that forced me to think creatively about how to represent motion and effects using only text characters.

Challenges

  • Representing motion and physics in a static terminal environment
  • Creating engaging visuals with limited characters
  • Balancing gameplay with realistic physics
  • Making the controls intuitive despite terminal limitations

Future plans

While this project is technically "completed," I occasionally think about improvements:

  • Add more enemy types and levels
  • Implement a story mode
  • Create a level editor
  • Add sound effects using terminal bell
  • Port to different platforms and terminal types