#13 | 26-8-24 | Code Modularity


Hello!

Progress on this project has stagnated. I intend to change that while I'm still on summer vacation, only one more week.

Now, onto today's subject. I got stuck on the idea I should make my spawning script modular and was severely disheartened when my first attempts failed. I tried to use scripteable objects and separate scripts for each wave, which didn't work.

Now, I have found a solution that works: lists.

Lists are expandable and the size can be changed easily, with the click of a button. For each new wave I write into the wave spawner script, there will be a new item (variable) in each list for it. Example pictured below:

In order to create a new wave, all I have to do is copy-paste the coroutine, rename it, and add new items to the lists (wave[], enemyWaveQuantity[]) and change their variables.

Modularity and expandability is incredibly important in creating an organized game. I also like to be very organized (in contradiction to my room) when building games or sorting files.

Thanks for reading!

Get Dead Alert

Leave a comment

Log in with itch.io to leave a comment.