PDA

View Full Version : Scrolling Images



cjmabry25
July 19th, 2008, 11:39
EDIT: Figured it out...er...ah...er....used a tutorial. Thanks. Mods please lock this topic. (:

Hi all! I just started learning Lua, and plan to make my way up to C++, but I'll stick to Lua for now.

Anyways, as my first project, I'm making a 2d side-scrolling spaceship shooter, and was wondering how to make my background images scroll to the left as if my ship was flying right.

I have created 4 background images each size 512 x 272, and they all connect together to make a long 2048 px wide image. My question is, how would I go about making image one scroll to the left, with image 2, 3, and 4 following behind, and then repeating. Would I have to use each image, or would having all of the backgrounds in one complete 2048 px wide image be easier and more efficient?

What would be the code to achieve this?

Thanks and sorry if this is a nubby question or is in the wrong place. Thanks again.