How do I create sound when all collectibles are collected?

From the Asset Store
Fully commented source code/event sheet & sprites to create a space shooter game
  • In my game I added some collectibles and next thing I want to happen is when you collect them all the "winning" sound plays. There are 20 on the map and when player reaches to 20/20 it starts playing a win sound.

    How to write it on event sheet?

  • You can either have a global variable that adds 1 every time you collect an item. Then say when global variable is 20, play the sound. Or you can count how many items are in the level, which is items.count and set this to a variable, when the variable is 0 that means no items remaining and you can play the sound.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can either have a global variable that adds 1 every time you collect an item. Then say when global variable is 20, play the sound. Or you can count how many items are in the level, which is items.count and set this to a variable, when the variable is 0 that means no items remaining and you can play the sound.

    I did that first option and when I collect 20 that sound plays endlessly even when I set "not looping". How to make it play only once?

  • Add system > trigger once while true

  • Add system > trigger once while true

    Thanks man, now it works

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