GlobKing
public enum GlobKingState
{
idle, slam, jump, die
}
public enum GlobKingDamageState
{
none, slam, jump
}
public class GlobKing : NetworkEntity, IHittable, IDamage
{
public AnimationComponent animationComponent;
public sfloat jumpSpeed = (sfloat)0.24f;
public int slamDamage = 20;
public int jumpDamage = 60;
public GlobKingDamageState damageState = GlobKingDamageState.none;
public HPComponent hpComponent;
public ObjectRect hitBox;
public GlobKingState state = GlobKingState.idle;
public float idleTimer = 2;
public sfloat maxChaseDistance = (sfloat)10;
public List<ObjectRect> hitboxes = new List<ObjectRect>();
public ObjectCircle slamAOEShape;
public List<ObjectRect> jumpDmgBoxes = new List<ObjectRect>();
//...
GlobKing is quite similar to Glob, but is an example of a simple boss or mini boss enemy. Again Think() method is where most of AI logic falls into place, where they decide to either sit around, jump at a player or slam their hands to the ground.
GlobKing is using Unity’s animation system rather then the one I wrote for this project. So if you prefer to use Unity’s animation system, reference that here.