Page 1 of 1

Moving the camera to side-scrolling?

Posted: Sun Apr 16, 2006 2:16 pm
by mordercinstinkt
Hey there again.

I was wondering...If I were to create a side-scrolling arcade type game, how would I go about placing the camera at the side of my character AND having it follow him at all times?

Also, if anyone wants to tackle this one, how do I make it so that you can only go so far backwards in a level?

Thanks you guys. This forum is awesome.

Posted: Sun Apr 16, 2006 5:32 pm
by GD1
dont know about limiting backwards movement, but sidescrolling is completely possible.

there are probably a lot of different approaches that would work, but here is what i would do. use a third person camera and lock mouse movement so that the camera will stay in the same place. then disable the player's forwards and backwards movement by removing them from control.ini (comment them out by putting the ";" symbol in front of them). now just make sure you're left and right strafe animations have the player facing completely to the right and completly to the left. strafe right would have him animated as running forward in the level, strafe left would turn him around and make him go the other way.

pretty simple when you think about it.

Posted: Sun Apr 16, 2006 8:42 pm
by AndyCR
to limit backwards movement, keep a variable that is always updated with how far the camera has gone in the sideways axis; compare every movement with that variable, and if the camera goes x units less than that variable dont let it go back any farther.