So for this week I've been working on adding enemies with AI that die when you shoot them and that sort of hunt the player and shoot at him/her. So far it's been really difficult. In previous games I've only really made enemies chase the player (Rainbow Waves) and enemies that have followed a predetermined path (Gene Pool Defense). This time around I wanted enemies that would do a little more/appear slightly more intelligent. However, my inexperience programming AI and my tight deadline really forced me to think about making the enemy AI very very simple. Well, I've been programming since my last update and have finally got my enemies moving around and performing their actions.
They...
- move randomly when not in range of the player
- move in one of the four cardinal directions towards the player when they're in range
- turn around if they hit a wall
- shoot in the direction they're facing just before they choose a new direction if the player is within range
- are destroyed if they leave the designated area (slightly larger than the screen)
- are destroyed upon contact with player bullets
Just getting them to do all of that was a huge challenge for me that I'm glad to say I overcame. Before the end of the day tomorrow I'd like to give them health, give the player health, make it so that if they touch or shoot the player then the player's health goes down, make it so that if they touch the player the player bounces off of them and is invincible for a second or two, make them spawn, make them spawn by having saucers fly in and spawning them, and finally I'd like to randomize a lot of their variables within a range to give them a more organic feel. Even though that list is pretty long I don't think I'll have a problem with it. The framework for most of it has been laid out. In fact, the framework for this game is nearly laid out. I'm pretty excited. Here's a screenshot of an enemy firing a bullet in my general direction.

No comments:
Post a Comment