Enemy Waves

0 favourites
  • 4 posts
From the Asset Store
Waves SFX Sea & Ocean contains 170 seamless loops.
  • I want to make many waves of enemies for a space-shooter type game, but I'm not sure how to go about it.

    Examples of what individual waves need to control:

    1. number of enemies

    2. types of enemies

    3. speed of enemies

    4. How fast they shoot

    5. when they shoot

    6. and just about every other property of space-shooter enemies you can think of.

    I was thinking arrays, but I'm not sure how to make individual waves with only 1 array.

    Cheers!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • take a look at the Space Blaster example under Intermediate Examples, it shows one way to do waves of enemies using a spawner with instance variables that tell what type and how many to create.

  • Just a few tips. The enemy move speed, shoot speed, and shooting behavior is best when it's contained in the object. You can create an enemy object as a sprite and add those properties as instance variables. Then add the custom behavior of how it moves and when it shoots in an event sheet. Then your "wave system" can just focus on which enemies to spawn and how many.

  • Unless you're having the same enemy moving at different speeds on different waves, you should do as Fib mentioned above.

    Now if you really want those values customizable on a per wave fashion, you could use an array or JSON. I, personally, think a JSON would be better.

    A wave JSON could look someting like this:

    {
    	"waves": [
    		{
    			"enemyTotal": 10,
    			"enemyTypes": [0,1],
    			"enemySpeed": 100,
    			"enemyShootingInterval": 0.2
    		},
    		{
    			"enemyTotal": 17,
    			"enemyTypes": [0,1,3,7],
    			"enemySpeed": 120,
    			"enemyShootingInterval": 0.2
    		},
    	]
    }
    

    Hope this helps!

    Cheers!

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