2D Side Scrolling Game

Started by
1 comment, last by dantheman1337 14 years, 1 month ago
Hello everyone I am looking for some help especially as it is a scrolling game as to how would i attach my camera to the player and background moves in the opposite direction of the player...some advice and tutorials would be of great help...
Advertisement
I hope these help you out here, SDL Lazyfoo has scrolling and scolling backgrounds for you to take an example look at the logic.

Scrolling

Scrolling Background
if you are using opengl, simply use this:



glTranslatef(-playerx, -playery, -playerz);




if the y is fixed then replace playery with your y coord.




if the y is sorta fixed but raises or lowers if necessary, simply plug in a variable that changes when nessecary.

This topic is closed to new replies.

Advertisement