protected override void OnUpdate() { //base.OnUpdate(); MoveInstantly(new Vector2(speedX, speedY), MoveType.RelativeTime, true); OnUpdateHitbox(); if (time <= 0f) { DecreaseHealth(int.MaxValue); } else { time -= Time.TimeMult; FollowNearestPlayer(); } foreach (ActorBase collision in api.FindCollisionActors(this)) { if (collision is Player) { DecreaseHealth(int.MaxValue); owner.OnPlayerHit(); // ToDo: Frog } } }
public override void OnHandleCollision(ActorBase other) { switch (other) { case Player player: { DecreaseHealth(int.MaxValue); owner.OnPlayerHit(); player.MorphTo(PlayerType.Frog); break; } } }