Attack Decisions

Monsters can have different kinds of attacks and they decide what attack to use based on the circumstance. Attacks have some kind of “tell” so players who pay attention can know what’s coming.

The simplest enemy in the original game is the Squish. He walked back and forth with no player sensing ability at all. He’d detect walls and cliffs with rectangle intersect tests and flip direction if needed. If the player touches the Squish then the player receives damage. Actually if the player touched any of the enemies they’d receive damage. That was easy to do but I didn’t really like how it turned out in the end. It was easy to program pretty challenging AI because the enemy would just have to run around and the player would have to make sure never to touch them. Some enemies enemies would shoot stuff at the player too but that was just more touch-based damage.

In the new Glace damage will work a little differently. Enemies this time around have actual attacks, outside of just trying to occupy the same spot as the player. In fact Glace won’t be damaged by just touching an enemy. The enemy needs to perform some kind of attack and that attack has to connect for damage to happen. If you’ve played many games you can probably see why this is more interesting.


It’s true that it takes more work for this kind of setup, but it’s worth it in my opinion. There were a few cases in the original game where it was downright annoying for enemies to damage you upon just a touch. Not only does it hurt you, but it totally slows your roll. Glace likes to move fast and that means there’s not a lot of time to react to an unexpected enemy moving within view. You’d hit the enemy and be stunned for a second (which is also a little annoying), and then you’d have to get back up to speed and get on with your business. Another pain point is when Glace jumps down onto a lower platform, he’ll sometimes fall on top of an enemy that was pretty much impossible to avoid. Cue the stun. No likey. With this new way of handling damage, Glace would jump down onto the platform and not be immediately damaged. The player would potentially have a chance to respond to the situation. The enemies would be just as surprised as you as they decide what kind of attack to deploy.

Come to think of it that stun mode that Glace enters after being damaged is super annoying. The way I look at it now is that taking control away from the player, even for a second, should be kind of a big deal. Maybe there’s a stun affect that certain enemies can inflict but it shouldn’t just be handed out all willy nilly. I think I’ll look into changing that for the new edition. Probably go with zero stun time and not have the player knocked back much or at all. Like I said there could be certain powerful attacks that would reserve those effects. Lots of work to do! Thanks for reading.