How can I make a x2 powerup?

developer6810developer6810 Member Posts: 139
edited July 2012 in Working with GS (Mac)
On my game, I have a score that increases every second as well as some items you can get that increase the score. I want to make a powerup that if the main actor overlaps or collides with it, the score from then on (for both the increasing every second and the items you get) for 10 seconds gets times 2. How would you do that?

Best Answer

  • Braydon_SFXBraydon_SFX Posts: 9,273
    Accepted Answer
    You would probably make a boolean attribute and set it to false. Call it x2, or something.

    Then, when you get that power-up, change it to true.
    Then, create a rule:

    When attribute game.x2 is true,

    Now, you'll have to duplicate all of your adding score rules and put them in the rule above.

    Now, just multiple everything by two.

    So if your getting 10 points every second, in the x2 rule, change it to 20 points every second etc.

    Then, after 10 seconds, change x2 to false.

    You get the idea...

Answers

  • developer6810developer6810 Member Posts: 139
    thanks
  • developer6810developer6810 Member Posts: 139
    @Braydon_SFX

    If I did it that way by just adding the new rules, wouldn't the old adding rules and the new ones overlap and you would get like 3x the amount of points?
  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    You would have to wrap the regular points in a rule that says when attribute game.x2 is false. Sorry, forgot that bit.
  • developer6810developer6810 Member Posts: 139
    Yeah, I figured that...
  • developer6810developer6810 Member Posts: 139
    @Braydon_SFX

    I got it to work, but after the 10 seconds are over, the x2 keeps going, although I made sure there was a rule with a timer: after 10 seconds change attribute x2 on to false. Any ideas?
  • developer6810developer6810 Member Posts: 139
    @Braydon_SFX

    Yeah, for some reason, the boolean attribute is not changing back to false...
  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    On the timer that changes it back to false, check run to completion and see if that fixes it.
  • developer6810developer6810 Member Posts: 139
    yeah, i got it
Sign In or Register to comment.