Horizontal/vertical Scrolling Game Help


namco

Member
Joined
Mar 22, 2006
Messages
410
Age
41
Location
Manchester, UK
Website
www.stupendous-stuff.com
Sorry if this is a little of topic but I'd like to make a scrolling shoot 'em up (like 1942) for the GP2X but I'm not sure how to implement the scrolling bit. Does anyone know any online tutorial that shows how to do this, either in SDL or DirectX (the DirectX would be useful for later windows game programming if I need it).

Thanks.
 
namco posted on Jul 20 2006 at 01:05 PM said:
Sorry if this is a little of topic but I'd like to make a scrolling shoot 'em up (like 1942) for the GP2X but I'm not sure how to implement the scrolling bit. Does anyone know any online tutorial that shows how to do this, either in SDL or DirectX (the DirectX would be useful for later windows game programming if I need it).

Thanks.

http://lazyfooproductions.com/SDL_tutorial...n19/preview.php

To summarize waht happens, is you have one background, but as it moves say down the screen you draw it again at the top to fill in the gap. You do this right and it appears that it is one contigous background.

By the way SDL is complatible with windows
 
Last edited by a moderator:
Personally, I like to take one source image (Taller than 240 pixels..) and move an SDL_Rect in the size of the GP2X screen resolution (320x240) to pull the image data from and draw that Rect out to the screen.

Personally, I like to take one looping image and move an SDL_Rect in the size of the GP2X screen resolution (320x240) to pull the image data from and draw that Rect out to the screen. To actually scroll, I raise the y value or x value of the source SDL_Rect to change the source material .. and when it reaches its limit, reset it. If it doesn't need to loop, even easier.
 
Back
Top