Does anyone know this?

Billyd1Billyd1 Member Posts: 133
edited November -1 in Working with GS (Mac)
Does anyone know how to make a actor expand when touch is pressed?

Comments

  • reddotincreddotinc Member Posts: 653
    when touch is pressed

    change attribute self.width to X
    change attribute self.height to Y

    :)

    // Red Dot Inc
  • specialist_3specialist_3 Member Posts: 121
    Create a Rule and choose Event when Touched

    Use 2 interpolate behaviors for actor's height and width and set the duration for the expansion,
  • quantumsheepquantumsheep Member Posts: 8,188
    And to anticipate your next question, put two interpolate behaviours in 'otherwise' to change it back to its original size ;)

    QS :D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • reddotincreddotinc Member Posts: 653
    I guess my way was a little naive to the fact you might want it to gradually expand!.. Well now you have two choices :)
  • specialist_3specialist_3 Member Posts: 121
    @reddotinc

    actually if you put your change attributes inside a timer (with microsecond interval), it will have the same effect as interpolate. Interpolate is just convenience.
  • firemaplegamesfiremaplegames Member Posts: 3,211
    Also, the Timer method will correctly change the collision area as well.

    Rule
    When any conditions are valid:
    self.Size.Width < self.myMaxWidth
    self.Size.Height < self.myMaxHeight
    -----Timer Every 0.01 seconds
    ----------Change Attribute: self.Size.Width To: self.Size.Width+[some number]
    ----------Change Attribute: self.Size.Height To: self.Size.Height+[some number]

    I believe Interpolate does not update the collision area until the Interpolation is complete. That is how it used to be. Perhaps it has changed.

    If you don't need collision while expanding, I would use Interpolate.
  • specialist_3specialist_3 Member Posts: 121
    Joe, that's pretty informative. Didn't know that. Thanks.
Sign In or Register to comment.