Recurring behaviour without using Timer
Hello
I'm trying to repeat various actions in loops without using the timer.
example, move an actor on a scene between two points in a recurring loop and also mirror'ing an actor image in a loop so it switches every second.
Any help much appreciated.
I'm trying to repeat various actions in loops without using the timer.
example, move an actor on a scene between two points in a recurring loop and also mirror'ing an actor image in a loop so it switches every second.
Any help much appreciated.
Comments
So in effect you saying every x seconds, do something.
POKE 53272,21 make my game great
POKE 53272,23 make apple feature my game
POKE 53280,C borrow some of that Rovio unexplainable sticky magic
Works every time
"example, move an actor [in] a scene between two points in a recurring loop"
Constrain X position to:
AAA*cos( self.Time *BBB)+CCC
AAA = the size of the movement from the centre point - so sticking 500 here will move your object 250 pixels left of the centre point and then 250 pixels right of the centre point and then 250 pixels left and then 250 pixels right of the centre point . . . . forever or up until you die, whichever comes first.
BBB = the speed of the movement.
CCC = the centre point of the movement.
In this example (100*cos( self.Time *100)+400) the actor will move left and right in a loop, 50 pixels each way . . . so it will move from 350 to 450 back and forth forever (see caveats above about your own demise).
1) Get your actor . . . inside GS make a copy . . . flip the second actor horizontally.
2) Place both actors in the scene on top of each other.
3) On the top actor place a timer: Every 1 second change attribute alpha to 1-alpha.