Issue #56 Implement enemy waves logic #75
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Wave logic is implemented by 3 scene and 3 matching script (fully documented) in the subfolder enemy_wave:
Most important is the enemy_waves_manager: has all the method and signal to manage all the wave logic gameplay (you don’t need to use enemy_wave and enemy_group, except to design the level wave using only the editor…no script).
This system is generic and can be used in every level.
To create custom waves in your level, follow these 5 steps:
That’s all.
enemy_waves_manager has a main method to start the next wave: start_next_wave()
Call this, to start the next wave in the list (the first wave if that is the first call).
enemy_waves_manager use 4 signals to inform you about wave lifecycle:
Lastly, enemy_waves_manager provides you 2 method to know wave description: get_actual_wave_description()
get_next_wave_description()
And one method to know if there is a wave ready to go:
does_next_wave_exists()
To illustrate the process and for test purpose, there is a subfolder, test, in the enemy_wave folder that provides example of use and unit testing case.
An enemy_wave_test scene has been created to show a complete wave logic implementation: the script in the level root is fully documented.
Lastly, the level 1 of the game has been updated with enemy wave logic: a simple 2 waves logic (as example… need more waves and enemies).
Now, enemies are instantiated according to the logic of the wave manager (there is a script in the root level node to manage that).
Added a button to call the waves.
Todo: