Hi there, all!
First off, let me preface that while I do have a basic understanding of arrays, the grip I have on the concept is very loose. I understand just enough from the tutorials and the manuals to do what I want, but I'm starting to run into problems that I think could be solved by arrays, but I don't know how to proceed.
So, here it goes.
I plan to have levels in my game. Each level will have a certain number of certain times of enemies that will spawn. I think that it would be very useful to have stored data on each level of my game somewhere instead of filling in a ton of events for the game to have to go through each tick, which I can do with arrays. These arrays would be numbered, and then have the list of enemies as the index, and the number of enemies to spawn on that level as the value.
So the idea that I have is that the battle layout has a blank array of spawn data. Upon starting the layout, an event checks the number of the level the player is on, then fetches the corresponding spawn data from another array and fills the current array with that data. The layout then uses uses that newly filled layout for the actual game, subtracting from that battle array until numbers reach zero. When all numbers reach zero, the level is completed.
The thing I don't know how to do is create that prefilled array. Is there a way to make an array elsewhere, with the data pre-entered, and then have Construct call on that data? My knowledge on arrays is still a bit limited. The array I've used so far is pretty simple. It's a small 1D array with seven values, each which corresponds to a potential "lane" in my game that enemies can spawn in. So I use that array to determine if an enemy is already spawned in a lane, and if it is, it sets the value of the corresponding lane to false. When the enemy dies, that lane is returned to true, and can be used to spawn another enemy.
That's essentially the extent of my knowledge. I've got a system rigged up to fill the array at the start of the layout with the data I need.
Thank you for your time!