forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

image looping

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development
View previous topic :: View next topic  
Author Message
wekilledbambi03



Joined: 15 Oct 2005
Posts: 31

PostPosted: Mon Jan 02, 2006 12:49 pm    Post subject: image looping Reply with quote

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
View user's profile Send private message
MikeHaggar



Joined: 18 Jul 2005
Posts: 116

PostPosted: Mon Jan 02, 2006 5:18 pm    Post subject: Reply with quote

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:
Code:

frame=frame+1




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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
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