private void SpawnNeedle(SpriteOrientation orientation)
        {
            NeedleEnemy needle = null;

            for (int i = needles.Count - 1; i >= 0; i--) //Grab a dead needle from the list or...
            {
                if (needles[i].IsAlive)
                {
                    continue;
                }
                needle = needles[i];
                break;
            }
            if (needle == null) //make a new one if there were no dead needles to grab
            {
                needle = new NeedleEnemy(needleRect, this.Power, needleSpeed, needleFrequency, orientation, CollisionType.Liquid, MessageToReceivers);
                needles.Add(needle);
            }
            else
            {
                needle.Position = new Vector2(needleRect.X, needleRect.Y);
                needle.SetOrientation(orientation);
                needle.IsAlive = true;
            }
            CollisionDetector.AddCollidable(needle);
        }
Beispiel #2
0
 public virtual void SetTerrainList(List <AbstractTerrain> list)
 {
     foreach (AbstractTerrain c in list)
     {
         ICollidable collidable = (ICollidable)c;
         terrainList.Add(collidable);
         CollisionDetector.AddCollidable(collidable);
     }
 }
Beispiel #3
0
 public virtual void SetItemList(List <IItem> list)
 {
     foreach (IItem c in list)
     {
         ICollidable collidable = (ICollidable)c;
         itemList.Add(collidable);
         CollisionDetector.AddCollidable(collidable);
     }
 }