How can I make sure that I can spawn a number of enemies?

0 favourites
  • 3 posts
From the Asset Store
Pixel Enemies for SHMUP consists of 45 enemy ship sprites to be used in your game.
  • Hey,

    How can I make sure that I can spawn a number of enemies every few seconds and that there are a maximum number of enemies, for example every 3 seconds an enemy spawns and 20 enemies is the maximal, so if I kill some enemies it has no influence on the max number of spawns. After 20 spawned enemies, they wont spawn anymore.

    sorry for bad English i hope you will understand it

    thank you in advance

  • You can use a global variable counter as a condition i.e. spawn enemy while global var less than 20 and add 1 to global var every time one spawns. You could also use the count of the enemy objects, i.e. if enemy.count < 20 then spawn, this counts the number of enemies that exist, but this would only be used if you had a max of 20 at any one time and destroying them affected the count, I don't think that applies here but it's useful to know.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank You plinkie, It works

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