Game Dev in Progress… Day 12
Hello, its Thursday and I am still working my way towards becoming a game developer. Today, I was able to get half-way through Phase II: Core Programming of the 2D Course. Overall, the features that I needed to implement were not overly difficult. So my day was pretty relaxing in all honesty.
The first feature that I implemented today was a new enemy type. This feature took the longest to create because of the freedom in creating it and the many ways to implement it. It took me awhile to create an idea to what this new enemy would do and it took more time trying to figure out how to code. Essentially, I wanted this new enemy type to move towards the middle of the screen and do move side to side until it is destroyed. On top of that, I wanted it to fire lasers in a cone like area in front of it. After looking around the internet a bit, I was able to easily move the enemy into the right position and then reusing code from a previous feature, move it side to side. Then came the hard part of making 4 different laser shoot in a cone arc in front of it. I solved this problem by instantiating the lasers in a 45 degree angle, and then tweaking that angle a bit to fire in the right direction that I wanted.
The second and third features were pretty easy in comparison to the first one. The second feature was to create a balanced spawn system. Since I partially implemented that already when I was making the negative and multi-shot powerups, I just finished what I had. By using Random.value, I can set if statements that check if this value a percentage i.e if it’s Random.value > 80 do this. The code above means that there is a 20% chance that the if statement is true and it will run it. The third feature is to create an enemy shield. I already have a shield for the player so I just modified that code to work for enemies this time.
Anyways, that is it from me. Thank you for reading and have a nice day!
_
Cristian Aspacio