need help with Loops

Find quick help here to get you started with Hollywood
Post Reply
sesco
Posts: 36
Joined: Tue Oct 18, 2011 6:40 am
Location: Toronto, Canada

need help with Loops

Post by sesco »

ok so i have 2 Sprites (Sprite1, Sprite2) and I have a loop routine working with Sprite1 fine but I also want Sprite2 to run the same loop as well.
How do get Sprite 2 routine going at the same time as Sprite 1 on the screen since Sprite 1 loop has " Repeat/ WaitEvent/ Forever" to make it work continuously.
A1-X1000- I BELIEVE
sesco
Posts: 36
Joined: Tue Oct 18, 2011 6:40 am
Location: Toronto, Canada

Re: need help with Loops

Post by sesco »

lol ok played around and put loop2 inside the loop1 and all ok :D
A1-X1000- I BELIEVE
Bugala
Posts: 1178
Joined: Sun Feb 14, 2010 7:11 pm

Re: need help with Loops

Post by Bugala »

If you want more control, possibility to control both sprites separately, you could look at "SetInterval" command.

Idea with SetInterval is that you can make a loop that is being executed while "WaitEvent" is waiting for something to happen.

You can set several intervals, for example, one for each sprite loops, and then you can turn these intervals (=loops) on and off as you wish, making it possible to run only one of the loops, both of the loops at same time or neither of them as you wish.
sesco
Posts: 36
Joined: Tue Oct 18, 2011 6:40 am
Location: Toronto, Canada

Re: need help with Loops

Post by sesco »

@ Bugala

thanks for the tip :)
A1-X1000- I BELIEVE
Post Reply