Пример #1
0
 protected void friendEnter(EnemyEntity ent, float distance)
 {
     if (this.Target == WumpusTarget.NOTHING)
     {
         // Must find better algo
         var direction = MathHelper.directionFromPointToPoint(
             this.Location, ent.Location);
         if (ent.State == EntityState.MOVING)
         {
             if (this.State == EntityState.MOVING)
             {
                 if (ent.Rotation != this.Rotation)
                 {
                     ent.Rotation = Rotation = (ent.Rotation + this.Rotation + direction) / 3;
                 }
             }
             else
             {
                 Rotation = (ent.Rotation + direction) / 2;
             }
         }
         {
             this.Target = WumpusTarget.FRIEND;
             this.State  = EntityState.MOVING;
         }
     }
 }
Пример #2
0
 protected void enemyEnter(EnemyEntity ent, float distance)
 {
     Rotation =
         MathHelper.directionFromPointToPoint(this.Location,
                                              ent.Location);
     if (distance <= this.ActiveWeapon.AttackRadius)
     {
         this.State = EntityState.ATTACKING;
     }
     else
     {
         this.Target = WumpusTarget.ENEMY;
         this.State  = EntityState.MOVING;
     }
 }