Beispiel #1
0
 public void AddObject(WorldObject obj)
 {
     WorldObjects.Add(obj);
     if (obj is IPlayer)
         Player = (IPlayer)obj;
     if (obj is IDynamicObject)
         DynamicObjects.Add((IDynamicObject)obj);
 }
Beispiel #2
0
 private bool isWithinSight(WorldObject worldObject, float sightRadiusSq)
 {
     return
         Math.Pow(worldObject.Position.X - _position.X, 2) + Math.Pow(worldObject.Position.Y - _position.Y, 2)
         < sightRadiusSq;
 }
Beispiel #3
0
 /// <summary>
 /// Safely Destroy Even in ForEach
 /// </summary>
 /// <param name="obj"></param>
 public void SafelyRemoveObject(WorldObject obj)
 {
     _removalList.Add(obj);
 }
Beispiel #4
0
        void goodRoid_Destroyed(WorldObject obj)
        {
            PlayerProfile.CurrentGoodNumber -= 1;

            if (PlayerProfile.CurrentGoodNumber == (PlayerProfile.RoidsToNotBlast - 3))
                Death();
        }
Beispiel #5
0
        void badRoid_Destroyed(WorldObject obj)
        {
            PlayerProfile.RoidsToBlast -= 1;

            if (PlayerProfile.RoidsToBlast == 0)
                EndGame();
            else
                this.Write("Roids to Blast: {0}", PlayerProfile.RoidsToBlast);
        }