How do I make events "not loop"?

From the Asset Store
14 amazing sound files of game events like Level Ups, Level Completes, object spawn, object taking etc.
  • (Sorry bad english)

    I am making a space ship game, and I want to the enemies drop power-ups. But I can't figure out a way to do that that doesn't loop all the time. I don't know if I am explaining this the correct way, so here's an image of my events.

    Somebody help me please

    Translation:

    inimigo = enemy

    bala = bullet (space ship projectile)

    explosão = explosion (effect)

  • You mean you need 1-in-5 chance to drop a power up?

    random(0,5) will generate a random number between 0 and 4.99999999999, it will never be exactly 5. Change your condition to random(5)<1, this will give you a 1-in-5 chance.

    Another option: choose(1,2,3,4,5)=5

  • You mean you need 1-in-5 chance to drop a power up?

    random(0,5) will generate a random number between 0 and 4.99999999999, it will never be exactly 5. Change your condition to random(5)<1, this will give you a 1-in-5 chance.

    Another option: choose(1,2,3,4,5)=5

    Thanks for the tip, but I want to also know how to make the events not loop, like:

    When I shoot an enemy, it will verify if the variable PowerUp is 5, and when I make that sub-event, it will keep creating PowerUps. Here's an image to clarify:

  • Another example is:

    I want to make a music start when I am in a certain area, but when I make a:

    "When Player is here, this music play"

    The music keeps repeating

  • there is no loop in the screenshot you posted in your first comment. "On collision" event happens only once, and the enemy is destroyed. So the sub-event is never repeated.

    With music you need to assign a tag to the audio and check that this tag is not already playing.

    If player X>2000
    Audio "music" is NOT playing
    	Audio play Music with tag "music"
    
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • there is no loop in the screenshot you posted in your first comment. "On collision" event happens only once, and the enemy is destroyed. So the sub-event is never repeated.

    With music you need to assign a tag to the audio and check that this tag is not already playing.

    > If player X>2000
    Audio "music" is NOT playing
    	Audio play Music with tag "music"
    

    Thanks very much

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