Side-Scrolling
Posted: Thu May 28, 2015 1:27 pm
Hello,
I am very new to game development. I'm working on my first game and decided on a side-scroller. I know I can add segments to cpSpace and then just adjust their x-axis position so that slopes and gaps match up; moving the tile graphics as well.
My problem is, my player polygon is moving with inertia and will eventually leave the screen. I can't figure out a way so the player moves normally with they physics engine, but stays static while just the map moves.
I think the answer is the polygon does go "off screen" but the graphic sprite is drawn with some sort of X-axis offset. I am just not sure how to go about doing this.
Any points or tips would be much appreciated.
I am very new to game development. I'm working on my first game and decided on a side-scroller. I know I can add segments to cpSpace and then just adjust their x-axis position so that slopes and gaps match up; moving the tile graphics as well.
My problem is, my player polygon is moving with inertia and will eventually leave the screen. I can't figure out a way so the player moves normally with they physics engine, but stays static while just the map moves.
I think the answer is the polygon does go "off screen" but the graphic sprite is drawn with some sort of X-axis offset. I am just not sure how to go about doing this.
Any points or tips would be much appreciated.