Im trying to think of a way to create a scrolling level and need some help on the best way to do it, plus a little code help if possible?
About the game:
I have a tank which can move in all directions with the WSAD keys, Id like the level to automatically scroll forcing the tank forward, while the level moves my tank is able to move forward backwards and side to side in all directions but if the tank hangs back to far the scrolling level will keep going forward essentially pushing me (the tank) forward. So the level is constantly or always moving forward as I move and react in that space.
Also my camera is attached to the tank in a 3rd person view somewhat behind the tank.
Im stumped on how to achieve the scrolling level part while pushing the tank forward? Does anyone have any thoughts on the best way to achieve this?
My initial thought is to somehow move the level itself backwards with a certain speed or velocity to give the feel of being pushed forward but how would I constrain the tank to get pushed forward?
Or I guess I wouldn’t have to worry about constraining the tank because the level would be moving backwards, Im thinking I would have to make it so the tank can only go a certain distance forward while the level goes backwards.
Would this be a good approach or is there a better way?
The more I think about it the more confused I get LOL I sure hope someone can help Im stumped.
Cheers! Zeek