Handling player/background movements in 2D games
Posted
by
lukeluke
on Game Development
See other posts from Game Development
or by lukeluke
Published on 2011-11-28T15:55:30Z
Indexed on
2011/11/28
18:55 UTC
Read the original article
Hit count: 264
Suppose you have your animated character controlled by the player and a 2D world (like the old 2D side-scrolling games). When the user press right on the keyboard, the background is moved to the right. If the path is always horizontal, this is simple to do (incrementation/decrementation of the x-coordinate).
But suppose that the path is instead a polygonal chain. My questions are:
- How do you move the background?
- How do you move the background if the game objects are managed with a physics engine like box2D?
© Game Development or respective owner