Particles on touch (destroy)

cnmeyer1980cnmeyer1980 Member, PRO Posts: 211
edited July 2012 in Working with GS (Mac)
Hi guys,

I hope you're all well.

It would make my weekend if someone could help me with this.

Basically, I have a actor (my main actor) who bounces around the screen to collect stars - simple - when the actor touches the star it vanishes, yep, this works fine - now, the thing I'm trying to do is to create a little star burst when the object vanishes (to basically make it look a little nicer, and more rewarding as the game is aimed at young children).

I could do it like this, if the star it touched by the actor, vanish and spawn a animation, however, it would be great if it could trigger a little particle star burst rather than spawning another animation.

I'm sure that I saw a tutorial on here a while back, however I can't seem to find it anywhere, so maybe I'm wrong.

I'm going to see if I can work it out, but if anyone knows a way of making objects vanish (rather than just a destroy) in a fancy way, I would love to know.

As always, thanks again to everyone on the forum and for your constant help.

Cheers,
Chris

Comments

  • RPRP Member Posts: 1,990
    edited July 2012
    I found that spawning animations after an actor is destroyed were not that taxing on performance as long as they are short and sweet. You get more freedom with your "effect" via a pre-destined animation than with the particle emitter.

    Another method for making something disappear:
    Use the Interpolate Behavior. In the actor attributes, under the Color section you will see Alpha. You can set it to 0. Set it up so that your animation actor, or actor with a particle emitter attached has a Rule : when it collides with your star, Behavior: Interpolate: self.color.alpha To: 1. That will make it visible. Now this is where your probably want to add a timer in the mix (note: interpolate does have its own duration), for a second or two, before telling the next Interpolate behavior to switch back to 0, making it invisible again.

    The tricky things with particle emitters is that they need that little warm up time before their effect does what you need it to. A second or two may not be enough, that why an animation may work better in this instance.

    Hope that helps. Just woke up.. so if it does not I'll clarify. Yaaaawnnn... Seeks coffee
  • cnmeyer1980cnmeyer1980 Member, PRO Posts: 211
    Hey RP thank you so much for the above - all very useful - I'm going to give your 2nd method a go (doesnt sound to tricky and actually makes sense) - otherwise, I will do as you suggest above too and spawn animation.

    Cheers and thank you for taking the time to get back, much appreciated.

    I hope you enjoyed your coffee :)
Sign In or Register to comment.