Particle Help

bluebyu25bluebyu25 Member Posts: 500
edited November -1 in Working with GS (Mac)
Hey guys I am having a bit of trouble with a particle effect. When self.touches = 1 a particle effect plays for 2 seconds. However when self.touches = 2 I need it to go away. The problem is when you hit the actor twice relatively fast, the particle is still there at self.touches = 2 and i need to ONLY be visible when self.touches=1......if its 2 then it needs to go bye bye lol. I've tried a few different approaches with no success so far and was wondering if anybody had any ideas.

Comments

  • osucowboy18osucowboy18 Member Posts: 1,307
    You may have already tried this, but here's my guess.

    Rule:
    When self.Touches = 1 AND self.Touches != 2
    execute particles.

    End Rule

    Hopefully this solves your problem. I don't use particles that much, but that's my guess.

    - Alex
    _________________________________________________________________________________

    PDL Productions

    Vertical/Horizontal Level Select Template
    Mac Mini For SALE!!!
  • bluebyu25bluebyu25 Member Posts: 500
    Problem with that is that I only need the particle effect when self.touches=1.....bc when self.touches=2 it changes the image and the particle is no longer appropriate
  • ClaymotionGamesClaymotionGames Member Posts: 5
    Maybe you could try putting a blank if touch = 2 rule into the otherwise column of your touches = 1 rule?
  • bluebyu25bluebyu25 Member Posts: 500
    No good..I really think it just isn't possible. See the particle effect lasts for 2 seconds...and if the user presses the actor again before the two seconds has expired...it recycles to the top of the screen and respawns...but still with the particles going lol. When self.touches=2 it turns into a actor with a rocket hence the particle effect that looks like flames. So it looks really unpolished to have the actor spawn in when self.touches=1 and the image is the first one without a rocket on it but yet it still has flames.

    I am considering when self.touches=2 I will constrain X and Y positions for at least 2 seconds to ensure the particle effect runs its course. Not ideal, but I guess it will have to do. I just havent been able to find a way to cancel out the particle BEFORE two seconds passes, provided self.touches=2 within the 2 second frame.
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    try unchecking run to completion on your timer. That will kill the timer when the rule becomes invalid however sometimes it messes up the timer all together. its kinda a crap shoot sometimes
  • DizkoDizko Member Posts: 498
    I had a similar issue myself. I ended up making a self attribute that would then trigger the particle animation in another rule.

    So in your case I would make a self integer attribute.
    Make the touch rule to change that attribute to change from 0 to self + 1
    Then make the rule for the particles to active when self.attribute = 1
    Run a timer in the same rule and make it change that self.attribute to self + 1 again

    So after all is said and done, you should start a 0, first touch sets it to 1 and fires off the particles, then it automatically sets it to 2 after time and when you press the button again, it will get set to 3 and so on, not ever firing off the particles again.
Sign In or Register to comment.