Actor Shaking
iDeveloperz
Member Posts: 1,169
Hi guys in iStax I have added some bonuses you collect as you go up. But also there are bad items you can overlap.
One of them is an earthquake sign, when a can overlaps it I would like the table at the bottom of the screen to shake left and right for 3 seconds. How would one do this?
One of them is an earthquake sign, when a can overlaps it I would like the table at the bottom of the screen to shake left and right for 3 seconds. How would one do this?
Comments
Personally, I would create a global attribute (boolean) called 'shake'.
On the can actor create a rule such that:
When actor: overlaps or collides: with actor of type: earthquake sign:
Change attribute 'shake' to 'true'
(I don't know the starting position of your table just lets say the X position is 100)
On the table actor create a rule:
When attribute 'shake' is 'true'
Change velocity to 100 at 0degrees relevant to scene.
(add another rule inside the main rule) When attribute: self.position.X is >or= to 150
Change attribute self.motionX to -100
(add another rule inside the main rule) When attribute: self.position.X is <or= to 50
Change attribute self.motionX to 100
(add a timer in the main rule) After 3 seconds: change attribute: 'shake' to false.
I hope that reads the same as what I meant, it works for me in GameSalad but I'm useless at putting GS into words.
http://i43.tinypic.com/soafma.jpg
In the end did what I said work? Or did you do something else?