Scroll Shooter Power Up

  • I created a scroll shooter and have been trying to edit in Power Ups, I am using a Global Variable (EnemyDeath) which counts amount of times an enemy has been killed in a single game time to increase difficulty, I want to use this variable to count when there are a certain amount of enemy deaths, send out a power up going horizontally. I already have this code so far.

    EnemyDeath = 5 Create Object (Sprite) on layer “Game” at (random(LayoutWidth) , random(LayoutHeight))

    Set Bullet speed to random(10, 80)

    Set opacity to Self.Bullet.Speed

    but when I play the game, the game spawns millions of power ups when I only want the one.

    Is there a way I can use this to create a single moving power up or is there any other method?

  • Post .capx?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • that's because once you are hitting the number it's always true, so you need to add to the number once reached

    EnemyDeath = 5 Create Object (Sprite) on layer “Game” at (random(LayoutWidth) , random(LayoutHeight))

    set enemy death to enemy death+5

    Set Bullet speed to random(10, 80)

    Set opacity to Self.Bullet.Speed

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