Skip to main content
Tweeted twitter.com/StackGameDev/status/798709017526882304
added 155 characters in body
Source Link
Neil
  • 153
  • 5

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.

Edit:

When the projectile starts it hitwill be at the groundleft edge so I cannot centre here as there's no room outside the scene, same if the projectile gets to the end of my scene.

How is this situation usually solved?

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?

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.

Edit:

When the projectile starts it will be at the left edge so I cannot centre here as there's no room outside the scene, same if the projectile gets to the end of my scene.

How is this situation usually solved?

Source Link
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?