How do I spawn a boss after a certain kill count?

0 favourites
  • 4 posts
From the Asset Store
An educational game for counting pictures. An easy to use template for developers to build larger games
  • I'm trying to spawn a boss after a certain kill count (in this case 20). I created a bossSpawner object that should spawn a boss after 20 kills (global variable numEnemies). The problem I have is that the bossSpawner object spawn multiples sprites of the boss object instead of just one. Any suggestions on how to fix the problem? Please see my code below. Thanks in advance.

  • Look in this thread: https://

  • Basic problem is that the condition "numEnemies = 20" is true on every tick, and boss is spawned every tick as long as numEnemies is 20. Many ways to solve this, and you can use any of these you like:

    • Add "Trigger once" condition to your event after numEnemies = 20 condition.
    • Add 1 to numEnemies after spawning the boss (then numEnemies is 21 and not 20).
    • Add new global variable "BossSpawned" with initial value 0. Add condition BossSpawned = 0 to your event. Set BossSpawned to 1 after spawning.
    • You can add second condition using "count" expression so that Boss is not spawned is there is more than 0 instances of boss. (I haven't used "count". So I'm not sure about this.)
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Lumik, Thank you so much. It worked out.

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