Пример #1
0
 public override void Collide(PhysicalEntity other)
 {
     if (!active)
         return;
     if (other.ID == ownerID || other is Bullet)
         return;
     IDamageable damageableOther = other as IDamageable;
     if (damageableOther != null && damageableOther.Health > 0)
     {
         damageableOther.TakeDamage(10);
         if (damageableOther.Health <= 0)
         {
             GameState.AwardScore(ownerID);
         }
     }
     GameState.AddClientSideEntity(new ParticleSystem(90, Position, color));
     active = false;
 }
Пример #2
0
 public virtual void Collide(PhysicalEntity other)
 {
     float invMass = 1.0f / mass;
     Velocity -= (other.Position - _position) * invMass;
 }