Waves

zNiiCzNiiC Member Posts: 74
edited November -1 in Working with GS (Mac)
How do I have never ending waves in my game? Just simple spawning about 5 more enemies per wave and set up spawners so they spawn outside the map.

Comments

  • FallacyStudiosFallacyStudios Member Posts: 970
    Use a game attribute that you increase the number spawning based on the level or wave it is currently on.

    So lets say your first wave is only one. So make a game attribute and call it Spawn Num as an integer and give it 1. Then lets say you have another game integer called Wave Num and assign it 1 as well.

    Then put it somewhere in one actor where Spawn Num is set to Wave Num (you can also do a little math if you want it altered to a different num for example Wave Num squared +3 /2 or something odd like that. It will keep it every changing and you wont have to make any modifications. Be sure to increment Wave Num after each wave though.
  • zNiiCzNiiC Member Posts: 74
    Ok I did that, now how do I get it to spawn the enemy during each wave and tell it after all the enemies are destroyed to move on to the next wave?
  • FallacyStudiosFallacyStudios Member Posts: 970
    Create another attribute to keep track of the number of enemies you have. Something like

    game.Num Enemies to game.Num Enemies+1

    Set that up in whichever actor that is controlling the spawning if they are spawning individually.

    If you use the code idea I gave you above and if they are all spawning at once you can just set Num Enemies = to Spawn Num. Then in the actor in which they are being destroyed when hit or whatever have Num Enemies-1. Then in an actor when Num Enemies = 0 change scenes or whatever and have Wave Num +1

    ** Depending on when they are spawning you may need to set up another attribute to make sure that its not checking if it is 0 prior to them spawning or it will keep skipping through scenes. So you may need a boolean checking if the scene is loading and once it loads its set to false and then it can check when it is 0. If all that makes sense.
  • zNiiCzNiiC Member Posts: 74
    Ok I think I get it, now do I just use the spawn actor behavior to spawn the enemies?

    Here is the update video:
  • FallacyStudiosFallacyStudios Member Posts: 970
    Yes just use the spawn actor behavior to spawn the enemies. I usually create just one spawner actor and place it outside the screen. Then just set randoms to tell it where outside the screen to spawn the actors. It looks good. Good work.
  • zNiiCzNiiC Member Posts: 74
    Ok I'll try that. I'm definitely going to make new car models and make it more realistic
Sign In or Register to comment.