How do I stop my sound effects from playing at the same time

0 favourites
  • 3 posts
From the Asset Store
An educational game for Times Table. An easy to use template for developers to build larger games
  • It's happening around my game a lot it seems, as an example. I have a function where you can trade creature skins for money, the UI tells you how many skins you have remaining (all this works fine). When you have enough money/skins it will give you the item but also play a sound effect, if you don't have enough money/skins it won't give you anything and play an error sound.

    The problem is, if the player has just 1 creature skin the system reads they have at least 1 and trades it for money. At the same, it seems that because it reads how many creature skins I have it also reads that I have 0 because the purchase function is taking one off me when I do have one. This then too plays the error sound, so basically whenever I have one of something left and purchase something taking the count to 0 it plays both the purchase sound effect and error sound effect.

    Any help would be greatly appreciated.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Put them both into the same mouse clicked event as sub events and have the small_bug_skins = 0 as an else should work. It will then only run one of the events each time.

  • Thanks, plinkie, that did it!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)