Platformer Enemy Types
Tosanu
Member, PRO Posts: 388
I am trying to diversify the types of enemies I am making for platformer game, in the sense of behavior and movements. I have stationary enemies, enemies that move in a set pattern or sequence, and enemies that move in a set pattern but accelerate to attack a player. However, what I am hoping to make is an enemy that swoops or charges after a player, but then returns to its original position once it misses or moves out of range, especially if it was already moving in a pattern before changing its movement. Anyone have a suggestion or a tutorial to point to on this?
Comments
To add some more details to the question as I experiment over the last hour or so, sorry about the bump. I'm currently trying to make a flying enemy that constantly hovers back and forth. I've managed that with a Cosine constrained x position.
I also want to make it that when it senses the player within a Magnitude derived distance, that it charges the player while continuing its back and forth pathing, and then cleanly moves back up to the original altitude. I have a very hacked together version that almost does this by having its Y velocity increased and then an interpolation back to the original spot and the Y velocity zeroed out once the magnitude rule no longer triggers.
But this doesn't look like itd actually be functional as a game. Is there a better way to try to put this together?