image looping
Moderators: Shine, Insert_witty_name
-
- Posts: 31
- Joined: Sat Oct 15, 2005 10:56 am
image looping
i want the same image to be able to scroll accross the screen. currently i have it so that one image is is put at 0,0 then one at 480, 0 then 960, 0 and so on. is there an easier way then typing it all out? that way it could be infinite.
-
- Posts: 116
- Joined: Mon Jul 18, 2005 2:20 am
I did something like this in LUACave.
Use this:
and in your game loop:
or you can also do:
and in the game loop:
Use this:
Code: Select all
screen:blit(0-math.mod(frame,480),0,action)
screen:blit(480-math.mod(frame,480),0,action)
Code: Select all
frame=frame+1
or you can also do:
Code: Select all
screen:blit(0-frame,0,action)
screen:blit(480-frame,0,action)
Code: Select all
frame=math.mod(frame+1,480)