Inspiration

Three words selected: Space, Rocket, Magnet

After studying physics in high school, traditional 2D space shooters didn't make sense anymore, it relied on atmospheric drag to stop your ship when you let go of control. I wanted to create a space shooter game which lets players experience real newtonian physics.

What it does

Vector Duel is a local 1v1 2D space combat game which lets users experience real life rocket physics built with a custom 60fps physics engine.

Rockets maintain vector velocity unless counter-thrust is applied. Rockets launch tracking projectiles that follow the enemy, every impact transfers momentum. Charging the core to 100% unleashes a magnetic field which bends trajectory paths dynamically. (not really physics, but why not)

How we built it

Frontend/UI: React and Tailwind css Physics engine: A custom javascript loop which calculates vector movement, rotational inertia, and elastic collisions.

Challenges we ran into

  1. Elastic Collision Math: Calculating realistic 2D elastic collisions between the asteroids, rockets, and projectiles required resolving relative velocity vectors on every frame.

  2. Electromagnetic Force Fields: Calculating magnetic attraction and trajectory bending meant computing continuous radial force vectors toward a point.

  3. Time-Rewind State: Implementing temporal rewind required building a custom circular ring buffer that continuously serializes the complete game state. Writing the code to rewind backward smoothly while maintaining physics was a tough hurdle.

  4. Solo Full-Stack Scope: As a single developer, balancing low-level canvas, vector math, UI HUD design in react, sound timing, control mapping for two local players on one keyboard, and deploying within a strict time constraint was quite hard.

Accomplishments that we're proud of

The feel of newtonian physics, the physics engine, and the process of learning to code the formulae.

What we learned

Learned how to structure composite rendering layers to maintain steady fps.

What's next for Vector Duel

Online multiplayer, expanded arsenal, and whatnot.

Share this project:

Updates

Submission history