Day 11 The Best Weapon against an Enemy is another Enemy!

Mark Bohuslav
3 min readDec 5, 2020

--

Today I created a new Enemy Type with its own Sprite and unique projectile. I also Created an Enemy Wave system based on the player score and I added lots of new sounds. First off, lets discuss the new Enemy variant:

oh no what have I created!!! Humanity does not stand a chance against such power!

I scoured the internet for a decent model, but could not quite find one that fit the bill so I used GIMP on one of the models I found and gave it a brand new paint job so that it would fit the style I was going for in the game. You can see the enemy above. I think it came out pretty good. Next I wanted the enemy to have its own unique projectile so I had him do a rapid fire of 3 circular projectiles. I made them slightly faster than the basic laser. I also added a unique sound effect to this projectile and sound to the original enemy laser.

To choose between enemies I used an int called Enemytype in the Spawn Manager and had it generate a random value of 0 or 1 since I have 2 enemy types at the moment. I changed the Enemyprefab variable to an Array and embedded the Enemytype in this array. Then because I had a wave system now I used a Switch statement with variable _enemywave that goes through all the different wave scenarios. The UI Manager defines the enemywave number and sends the enemy wave information over when the player reaches a certain score. Within each case of the switch statment I also put for Loops in there since at each progressive wave we would be spawning more enemies, so the For loop would run the code multiple times at the higher waves.

Overall I am happy with the approach, it seems like a lot of code but gives a lot of flexibility for each wave as I can custom tailor special events in each respective wave. I felt very satisfied with this particular achievement as I integrated Switches, For Loops, Communicating between different scripts and the end result was great.

On the enemy script side I used an _enemyID for each of the prefabs and another switch statement to determine their firelaser routine.

Within the UI Manager I created a Text that flashes at the top of the screen to indicate a new Wave was coming along with an alarm sound when a new wave began. I also took the time to add an Evil Game Over laugh when the player dies. Check out the video below to hear all the new sounds and see the new enemy!

https://youtu.be/fm3nLFGCHW4

Today was fun because I got things done on the programming side, on the artistic side with my model and editing some sounds. I also had success helping out my team members on a couple of their issues which made me feel good that I can contribute. It was nice to be able to understand their code, what they were trying to do and figure out a solution. That showed me that everything is starting to sink in.

Overall it was a great day and I have some neat ideas on things I want to implement in the game in addition to the coursework, maybe I will work on some of them this weekend along with the C# survival guide.

That being said my game is getting hard with all the new movement systems, weapons and new enemy waves. I will definitely have to do some balancing when I finish Phase 2.

Mahalo!

--

--

Mark Bohuslav
Mark Bohuslav

Written by Mark Bohuslav

Game Developer Intern at GameDevHQ

Responses (1)