change actor size for 10 seconds then change back?

developer6810developer6810 Member Posts: 139
edited July 2012 in Working with GS (Mac)
I have a main actor (w-75 h- 35) and want to add a powerup so when the main actor overlaps or collides with the powerup, it's width (only width) increases by 50 (to 125) and then switches back to 75 after 10 seconds. I've tried adding a timer that changes width FOR 10 seconds, I've tried changing the width right after they come in contact and then adding timer AFTER 10 seconds change back to normal width. Both these things changed the width to 125 but after 10 seconds it didn't change back. Any ideas?

Best Answer

  • tenrdrmertenrdrmer Posts: 9,934
    Accepted Answer
    Make a separate rule in the actor.

    When Self.Width=125
    --After 10 Seconds Run to Completion true
    ---Change self.Width to 75

Answers

  • developer6810developer6810 Member Posts: 139
    @tenrdrmer

    So additionally, you would need to make a rule that when the powerup and the actor collide, change self.Width to 125?
  • J_PANJ_PAN Member Posts: 140
    you can have self attributes that save the actor's size before it takes the powerup then have it rule that changes the players size (in a timer)
  • developer6810developer6810 Member Posts: 139
    @tenrdrmer

    So what exactly does "Run to Completion" do?
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    It makes sure the timer completes the task even if the conditions that triggered it are no longer valid
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    And yes you still need to rule to also change the size up to 125 but you seem to have that working right? So you just need to make sure you remove all the changing back down from those rules
  • developer6810developer6810 Member Posts: 139
    Yeah, I have that working. Thanks!
Sign In or Register to comment.