GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Stop the Sounds

dynamobytedynamobyte Posts: 1Member
HEllo There i'm noob in Gamesalad World! ^__^

I need to play multiple sounds (for this reason i use "sounds" and not "music" object)

in my app i need to stop them touching the same buttons that i use to start these sounds.

For Example: clicking on Actor1 it plays sound named "sound1"
While clicking on Actor 2 plays "sound 2" etc etc

Re-touching the same actors i want to stop music

How can i do this?

Comments

  • forkliftforklift Posts: 386Member
    I would use a boolean attribute for each actor. In this case, I'll call it self.sound. Start it being false.

    Rule To Turn Sound ON:
    Set up a rule that will run when ALL (conditions) are true.
    -(When actor 1 is touched)
    -(self.sound = false)
    --change attribute self.sound to true

    Rule To Turn Sound OFF:
    Set up a rule that will run when ALL (conditions) are true.
    -(When actor 1 is touched)
    -(self.sound = true)
    --change attribute self.sound to false

    Rule to play the sound:
    When self.sound = true, play sound
This discussion has been closed.