First off, I finished sanding my little robot and sprayed him with a Prime :D Soon I’ll be painting him *_*. Anyway, back to the programming!

I added a couple of different methods for wandering, the one I showed previously was the Random Direction one. Forward one simply will reverse the forward transform when it encounters and obstacle (will pretty much keep on moving in a line). Bouncing works like the weapons work, when he encounters an obstacle he calculates the reflected vector between him and the wall and rotates into that direction. This will help me to get extra different behaviours of enemies :)

I also finally programmed an enemyAttack class, and extended it into a enemyShoot class. In my enemyShoot class I made several variables to control different aspects of the way the enemies shoot, with that I can make a large amount of different behaving enemies without having to write extra code :D Here are some examples:





Certain things like attack interval are controlled by the EnemyAI script, but there is still a lot of variables specific to the enemyAttack.





Projectile Angle variation will add random variation to the shot, the bigger the number the bigger the random variation.





Angle of Attack will spread the shots within the desired angle equally. If I want to add random variation on top of this I can add projectile angle variation.





With Bullets Per Shot interval, it will wait for that amount of interval between each bullet being shot. If Shuffle Bullet Dir is turned off it’s going to shoot it in the order of the angles (First from the most extreme angle, then the next one, and so on) otherwise it’s going to shoot randomly through the angles.





If Ballistic is turned on the shots will lobby over and fall down in an arc. This coupled with projectiles that explode on contact could make for interesting enemies :D Ballistic time will control how long the projectile should take before hitting the ground and ballistic up controls how much it should go up on the lobby.





Wait before and after attack waits a moment before/after attack. If “Can Move During Attack” is turned off, this can be used to make the enemy stop for a moment while he is attacking.





Also did a charge attack, also extending from the enemyAttack script, so I can just plug the attack type I want for that enemy, I could also chain attack scripts together and rotate through them in the AI, in the case of a boss for instance. This is similar to what I did with the boss in Alva the Mighty.

So now I’m actually ready to start making enemies and rooms for the singleplayer. However I didn’t have enough time to actually make a bunch of enemy prefabs and rooms to test the singleplayer :( Hopefully in the next few days I’ll be able to do it. Well… That’s it for now! It was a productive weekend, even if it wasn’t as productive as I expected.