Grow and destroy

ijacket00ijacket00 Member Posts: 1
edited November -1 in Working with GS (Mac)
Hi,,

Hoping you can help, I'm creating an ipad game where the user controls the actor using the accelerometer. I have coins scattered randomly around the screen. How can I set it so that when the actor collects the coin, it will:

1. grow by a certain % or size each time
2. the coin will dissapear

I have used the grow rule, but at the moment the actor just keeps growing and the coin never dissapears (rule set to destroy). I have tried to put a rule in to limit the size, but I'm not sure what type of expression I might need. I hope that someone can help.

Thanks,

MC

Comments

  • DrGlickertDrGlickert Member Posts: 1,135
    Use change attributes.

    Rule on the Coins;
    When overlaps/collides with player destroy this actor

    Rule on the Actor;
    When overlaps/collides with coin
    change attribute: Self.size.width + x (where x is the amount you want to grow by, eg. 1, 2, 5, 8, whatever you want).
    change attribute self.size.height + x (same as above)

    Not sure I know what the "grow rule" is...
  • svnsvn Member Posts: 445
    The grow rule is a rule that tells the actor to grow by a specified scaling amount.
  • DaibusshiDaibusshi Member Posts: 47
    I had a somewhat similar problem, and discovered that if the actor is set to be destroyed during scaling, the scaling overrides the "destroy" and the actor will never disappear. In order to destroy the scaled actor, the scaling needs to be completed before the destroy can happen.

    In other words, I had to limit my actor to scale for only 2 seconds
    then destroy after 2.1 seconds.

    I know this isn't exactly the issue you are up against, but I would start by looking at your scale settings.
Sign In or Register to comment.