Discuss new features and future development.


Postby kansha » Thu May 28, 2015 1:27 pm


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.
Posts: 1
Joined: Thu May 28, 2015 1:17 pm

Re: Side-Scrolling

Postby tekk » Thu Jun 11, 2015 12:04 am

Your drawing is completely separate from the Chipmunk coordinates, in theory. What you need to think of it as is this: your camera is a box view of the chipmunk space that you created, and that box moves with the player. It has nothing to do with chipmunk, except maybe pulling the player position and checking how close to the edge of the camera's box is.
Posts: 3
Joined: Wed Jun 10, 2015 8:22 pm

Re: Side-Scrolling

Postby s_ridenour » Thu Dec 10, 2015 9:41 pm

Yeah, just move your "camera" with the player. Maybe have it a bit loose so that it doesn't follow the player 1:1 per pixel.
Posts: 2
Joined: Thu Dec 03, 2015 1:59 am
Location: Colorado, USA

Return to Features/Development

Who is online

Users browsing this forum: No registered users and 1 guest