public override void Collision(GameEntity target) { if (target is Player && state == MeleeBotState.Attacking) { velocity = Vector3.Zero - velocity; state = MeleeBotState.Idle; timeToGoBack = TimeSpan.FromSeconds(timeToGoBackSeconds); timeToPause = TimeSpan.FromSeconds(timeToPauseSeconds); timeToCharge = TimeSpan.FromSeconds(timeToChargeSeconds); charging = false; Player p = target as Player; p.takeDamage(damage); } else if (target is PlayerWeapon) { target.Collision(this); } else if (target is Explosion) { target.Collision(this); } else if (target is MeleeBot) { } }
public override void Collision(GameEntity target) { if (target is Player && !hitPlayerOnce) { Player p = target as Player; p.takeDamage(damage); hitPlayerOnce = true; } }
public override void Collision(GameEntity target) { if (target is Player) { Player p = target as Player; if (!(this is BotMissile)) //sheer impact of missile can't hurt the player { p.takeDamage(damage); } Die(); } }
public override void Collision(GameEntity target) { if (target is Player) { Die(); Player p = target as Player; p.takeDamage(); } else if (target is Missle) { target.Collision(this); } else if (target is Needle) { target.Collision(this); } else if (target is Explosion) { target.Collision(this); } }