Make game loop back to first level after beating last level#44
Open
Make game loop back to first level after beating last level#44
Conversation
Signed-off-by: AnimaRain <ioannis_spyr@yahoo.gr>
Spawners where not always being stashed correctly. This caused errors with the recursion, which led to not enough spawners being added to the list, and not having enough spawners to assign the patterns. Function SpawnerFactory had to be heavily reworked. Now it works correclty, but is also simpler, and makes more sense. Function ParseSpawnPattern is changed to return a dictionary instead of an array: 1) It is more convenient for being "piped" into SpawnerFactory. 2) It doesn't make sense converting the data from a dictionary to an array before returning, and then converting the array back to a dictionary. Signed-off-by: AnimaRain <ioannis_spyr@yahoo.gr>
This refactoring is reverting some changes in commit 1cc85a6, with some additional changes. There is a possibility that, previously, convertions to ulong were messing up the arithmetic results, but that has not been confirmed. Either way, after these changes, there shouldn't be this problem anyway. Signed-off-by: AnimaRain <ioannis_spyr@yahoo.gr>
Instead of, every time the number of levels is requested, going through the XML file and counting the nodes, it is calculated once and stored in a public property when the pattern file is loaded. Signed-off-by: AnimaRain <ioannis_spyr@yahoo.gr>
Signed-off-by: AnimaRain <ioannis_spyr@yahoo.gr>
Signed-off-by: AnimaRain <ioannis_spyr@yahoo.gr>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
After beating the last level defined in the spawn pattern file and the game tries to go to the next level, the number of the next round exceeds the number of levels defined in the file. This patch fixes the game to loop back to the top of the pattern file, and know how to map any round to a level in the file.