Okay, so the basic idea behind this enemy Is keeping the player away from the edge of the screen. The function of this enemy is to harass a player that is trying to kite or bottleneck his/her enemies, and attempt to force him/her into the center of the screen where they can surround him/her. This would likely be a flying or burrowing enemy that can avoid collisions to make things easier, because I have no plans to implement any kind of serious pathfinding yet.
here’s what I’m thinking:
-
determine the point on the edge of the screen the player is closest too. ( I have almost no idea how to go about this. I can’t even think of what criteria to use for evaluating whether a point is closer to the edge. something like summing the distances from the edges might make sense)
-
approach that point in a roundabout way, so as not to engage the player. Perhaps a question mark approach (approach player in a straigh line, then circle around them to get to the edge)? (For this I can use the lessons learned from my spiral movement behavior) Or, I don’t know, maybe the enemy is a turret that moves on a railroad track.
-
make lunging attacks at the player. the attack should be structured in such a way that its difficult to deal with when your attention is divided, advance quickly, attack, retreat quickly, rinse repeat. or maybe some knockback?
the biggest question I have, honestly, is how to determine what point along the edge of a border (say, the screen or a predetermined “encounter zone”[rectangle]) that the player is closest to.
any ideas or suggestions?