Actor Shaking

iDeveloperziDeveloperz Member Posts: 1,169
edited November -1 in Working with GS (Mac)
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?

Comments

  • RHRH Member Posts: 1,079
    (In this example I am assuming that the table doesn't normally move).

    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.
  • iDeveloperziDeveloperz Member Posts: 1,169
    Thanks RH just tried it, it didn't work but I think I have made a mistake whilst changing the shake to true. Here is the rule :)

    http://i43.tinypic.com/soafma.jpg
  • iDeveloperziDeveloperz Member Posts: 1,169
    Doesn't matter I just realized the table is unchecked at movable. Thank you though :)
  • RHRH Member Posts: 1,079
    Haha, well, as i said, I'm useless at converting GS physics into words, I did something similar and it worked for me.

    In the end did what I said work? Or did you do something else?
  • iDeveloperziDeveloperz Member Posts: 1,169
    No it worked, Thanks.
  • RHRH Member Posts: 1,079
    No problem, I'm glad it worked, shows that maybe my dreadful explanations can be understood :)
Sign In or Register to comment.