Skip to main content
1 of 2
Neil
  • 153
  • 5

Scrolling background after firing projectile

I have a projectile which I fire using the mouse coords as the direction vector which I scale with a velocity vector and add a gravity vector to complete this simple simulation.

projectile motion

I want to scroll the background in some elegant way, so that I can keep the projectile centred in the red (viewport) whilst following it until I can no longer centre it, but watch it hit the ground.

How is this situation usually solved?

Neil
  • 153
  • 5