Example #1
0
 public override void DetectEnemyHit(MovingObject mob)
 {
     //dont kill friends
     if (mob.Type == this.Type)
         return;
     //collision with enemy detected
     if(Position.Y > mob.Position.Y)
     {
         //enemy is above, cant kill
         return;
     }
     mob.Die();
 }
Example #2
0
 public override void DetectEnemyHit(MovingObject mob)
 {
     //collision with enemy detected
     if (Position.Y < mob.Position.Y - mob.Height / 10)
     {
         //hit enemy from above
         mob.Die();
         Score += 100;
         //bounce off of enemy
         CanJump = true;
         Jump();
     }
     else
     {
         Die();
     }
 }
Example #3
0
 public virtual void DetectEnemyHit(MovingObject mob)
 {
 }