Godot Version
4.3.3
Question
I am at the stage where I have to try and create a Modular spawning system for my game where it will detect the level which has been loaded through my SceneManager and it will just take the values in my wave_data array.
I have a general idea on how to implement it but due to the size of the array.
const wave_data1 = {
"Level01" : [
{"Enemies" : {"Beetle" : 10, "Wasp" : 2}, "Time" : 1 },
{"Enemies" : {"Beetle" : 10, "Wasp" : 2}, "Time" : 1 },
{"Enemies" : {"Beetle" : 10, "Wasp" : 2}, "Time" : 1 },
],
"Level02" : [
{"Enemies" : {"Beetle" : 10, "Wasp" : 2}, "Time" : 1 },
{"Enemies" : {"Beetle" : 10, "Wasp" : 2}, "Time" : 1 },
{"Enemies" : {"Beetle" : 10, "Wasp" : 2}, "Time" : 1 },
],
"Level03" : [
{"Enemies" : {"Beetle" : 10, "Wasp" : 2}, "Time" : 1 },
{"Enemies" : {"Beetle" : 10, "Wasp" : 2}, "Time" : 1 },
{"Enemies" : {"Beetle" : 10, "Wasp" : 2}, "Time" : 1 },
],
"Level04" : [
{"Enemies" : {"Beetle" : 10, "Wasp" : 2}, "Time" : 1 },
{"Enemies" : {"Beetle" : 10, "Wasp" : 2}, "Time" : 1 },
{"Enemies" : {"Beetle" : 10, "Wasp" : 2}, "Time" : 1 },
],
"Level05" : [
{"Enemies" : {"Beetle" : 10, "Wasp" : 2}, "Time" : 1 },
{"Enemies" : {"Beetle" : 10, "Wasp" : 2}, "Time" : 1 },
{"Enemies" : {"Beetle" : 10, "Wasp" : 2}, "Time" : 1 },
],
}
This is my array that I have just created and before I continued onwards I wanted to hear some thoughts by some more experienced coders so I learn more even going forwards. If my game for example has around 50 levels and each of those has around 50 or 100 waves for example would that be able to cause an issue with the general spawning or even running of the game?
I plan on creating 3 different SpawnerScripts where each has it’s own purpose. WaveInfo which holds the wave info and extends WaveInfo class. Wave class which extends Waveinfo and holds the Wave information for the current level and the WaveSpawner which extends from the Wave class so they are all interconnected. Would you say my approach is a good one at least?