 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
wekilledbambi03
Joined: 15 Oct 2005 Posts: 31
|
Posted: Mon Jan 02, 2006 12:49 pm Post subject: 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. |
|
| Back to top |
|
 |
MikeHaggar
Joined: 18 Jul 2005 Posts: 116
|
Posted: Mon Jan 02, 2006 5:18 pm Post subject: |
|
|
I did something like this in LUACave.
Use this:
| Code: |
screen:blit(0-math.mod(frame,480),0,action)
screen:blit(480-math.mod(frame,480),0,action)
|
and in your game loop:
or you can also do:
| Code: |
screen:blit(0-frame,0,action)
screen:blit(480-frame,0,action)
|
and in the game loop:
| Code: |
frame=math.mod(frame+1,480)
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|