Waves of zombies

Discussion in 'Plugin Development' started by 2jesper2, Jun 18, 2018.

Thread Status:
Not open for further replies.
  1. Offline

    2jesper2

    Hello,

    I've followed some tutorials on how to make a minigame, I got everything working except the wave system.
    I want to make waves with zombies, each wave more zombies and after a few waves the big zombie. But i've got no clue on how to do this, Can someone help me further with an idea to make this work?

    Thanks!
    Jesper
     
  2. Offline

    Zombie_Striker

    @2jesper2
    What do you have already, and what do you need help with? Do you have the stages/gamestates set up yet? Do you have the counter for the waves set up? Do you have the system that detects what the waves should do (do you have a timer for when the next round starts? Do you have a system to detect if all the zombies have been killed?)
     
  3. Offline

    2jesper2

    @Zombie_Striker
    I got gamestates, and teams all set up, I only need help with how to make waves, timer and detect when all zombies died, because I dont know where to start
     
  4. Offline

    Zombie_Striker

    @2jesper2
    Lets start with how to make the wave:
    1. Create a new Wave class. This will hold all the information for the waves.
    2. Inside the class, create an int field. This will hold the wave number.
    3. Then, create another int field. This represents the amount of mobs spawned in the wave.
    4. (Optional) if you need specific types of zombies to spawn on certain waves, turn #3 into a hashmap, make the keys EntityTypes and the values Integers. This will represent the amount of mobs of each type should spawn for that round.
    5. Go back to the GameState class where the waves should start. In it, create all the waves you want, with the amount of zombies you want for each wave. Store all of the waves in a List.
    6. Then, create an int. This represents the current wave the players are on.
    The above is just how to create the framework for the frames. Assuming you want it so the original wave is cleared out before the next wave starts, do the following:
    1. Inside the gamestate, create a List of Entities. This represents the amount of zombies there currently are.
    2. When starting the wave and spawning the zombies, add the zombies to the list.
    3. Listen to EntityDeathEvent. If the entity was a zombie from the list, remove the zombie from the list.
    4. Once the list is empty, close this wave, increment the wave count (#6 in the previous guide) and spawn in the next wave (using the int from #6 to get the wave)
     
Thread Status:
Not open for further replies.

Share This Page