Today I achieved to create my AWESOME WAVE creator that is super DYNAMIC BROOAAA!

1

9 februari, 2017 av eric01422

Today my Task was to create a dynamic Wave/round handler. The point of this handler is to be able to create effective and fast waves that works like levels in are games.  MY idé to progress in this mater was to create a game object that could control and handle waves that carried spawn points as there Children’s.

The result was a Splendid success! now it is one of are core script that will boost are production to the next level. The functionality’s in this scripts is as following.

wavemanager

The WaveManager, a object that keeps track of the waves and in with order they are going at. The key function of this script is it ability to turn on and of waves and set a delay on how long it will take to progress in to then next wave there after.

wavemanager

The Wave, this is a child Object to the WaveManager. its task is to keep track of the Spawn points and give a flag to the WaveManager if its OK to move on the the next wave.

wavemanager

Then we have the SpawnHandler. it is a child of the wave and the core of the wave create. the functionality of this object is to keep track of the amount of enemy on the field and where all Spawn Points are located.If its done with all actions then it send a flag to the wave object that then can check if all SpawnHandlers are done. each handler can hold one enemy type and set the rate it will spawn then and how meany its allowed to spawn.

some complication that i stumble upon was the fact that C# simple Arrays do not support a remove function at a specific index. why i wanted to use this function was because i needed a container to store all enemy’s it spawned in the wold and then remove then form the container when the object did not exist any more. what i ended up to do was to use a list instead BUT the normal list in unity did not support a List.at() function so i could not check if a specific element was null. But after some research i found out that you could instigate a using System.Linq that supported the at function i was looking for and this maid my day soooo much easyer! (later on i notes that you could use [] to get the element of a specific index as you do with arrays)

En tanke på “Today I achieved to create my AWESOME WAVE creator that is super DYNAMIC BROOAAA!

  1. olwiblog skriver:

    Going through the hierarchy of game objects in your spawn system was a good way to explain step by step what each object does. I think you should explain what part of system spawns the enemies better. I’m guessing that’s the spawn handler’s job but it isn’t clear in the post. Another thing you could include is why you chose the system structure that you did (were there any other ways to do it? Why did you choose the to do it the way you did?) Also, how do the different objects communicate with each other? Do they use a subject/observer system or something else? The way you explain your problem and solution with array indexes explains the code behind your system very well, if every step would’ve been explained that way, the blog post would be much clearer!

    Overall, your post explained what your system did very well, but programming patterns and other behind-the-scenes functions could be explained better.

    Gilla

Lämna en kommentar