Cleaning up the wave spawning.
|
Hello! I Am Christofer Mattsson the lead coder in team Leviathan. We are now under ten weeks working on a game called Draxl’s journey. We are now on the sexto week of production and our game is almost in beta. This week.This week I have mostly only continue working on the wave spawning script. I wrote about the wave spawning in my last blog post, so in this one I will talk about another problem I have had. So let get started with this week’s problem, and that being cleaning up and make the interface for the script easier to understand and to work with. If you look at the old interface it´s really hard to understand what everything is if you haven’t been working on it. ![]() So the first thing I wanted to change was to rename elements 0, element 1, element 2…. The solution I found was to use a small trick in unity. If you make a public string (String is a text variable if you didn’t know) variable named “name”, in the top of the class you make the array of. That will change the elements to be the same as the “name” variable. One other thing I wanted to change was to have solid start positions that you choose from instead of needing to type in the values for the start position. So I started to think out a grid system. So then I only needed to give every position in the grid is one X and Y value. That made it allot easier for the game designer because he didn’t need to figure out the values. He only needed to choose one of the set start positions. ![]() The last thing I wanted to do was to make the choosing of enemy and start positions to be a drop down menu. To do that was way easier than I thought. I only needed to make a enum with the names i wanted and unity created I drop down menu. (enum is a data types consisting of a set of named values. https://en.wikipedia.org/wiki/Enumerated_type ) ![]() So that’s it for me this week. Good luck on your journey! |


