how to stop a particular sound from playing on or off?

famekraftsfamekrafts Member, BASIC Posts: 834
I am not using destroy and spawn anymore, so a blast animation is placed outside the scene, problem is every time it starts a scene or resets it, the explosion sound starts playing, how do I stop a particular sound from playing, till the time it is not called for?

Comments

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited October 2012

    @wickedsunny

    Hi, you ideally don't want your animation to run either until it's placed on-screen....

    A simple boolean attribute acting as a switch will do it; let's call it BoomTime

    In your off-screen actor, put in its Rules:

    Rule: When BoomTime is true

    ----the following change of coordinates I'm presuming you've already got, to place the explosion on-screen when ready....
    Change Attribute self.Position.x to ??
    Change Attribute self.Position.y to ??

    Animate Behaviour
    Play Sound Behaviour

    Timer: After ?? seconds
    Change Attribute BoomTime to false
    Change Attribute self.Position.x to -50 --or whatever, to place it back off screen
    Change Attribute self.Position.y to 0

    ----

    Now when its ready to play, (on a collision, I guess?) put a rule in one of your on-screen actors: Change Attribute BoomTime to true. That's it roughly.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • famekraftsfamekrafts Member, BASIC Posts: 834
    @gyroscope Thanks, will give it a try. The problem is it is very complicated as there are 2 more Boolean attributes working together when the explosion is called for, maybe I will give a third attribute to play the sound only when its true.
  • famekraftsfamekrafts Member, BASIC Posts: 834
    Adding the third attribute worked. Thanks
Sign In or Register to comment.