Пример #1
0
 /// <summary>
 /// Generates specified number of gems in gameworld.
 /// </summary>
 /// <param name="count"></param>
 /// <param name="entity"></param>
 public static void Generate(int count, Entity entity)
 {
     for (int i = 0; i < count; i++)
     {
         Gem gem = new Gem(entity.GetCollRectangle().Center.X, entity.GetCollRectangle().Center.Y);
         GameWorld.Instance.Entities.Add(gem);
     }
 }
Пример #2
0
 /// <summary>
 /// Generates specified number of a particular type of gem in gameworld.
 /// </summary>
 /// <param name="gemId"></param>
 /// <param name="tile"></param>
 /// <param name="count"></param>
 public static void GenerateIdentical(byte gemId, Tile tile, int count)
 {
     for (int i = 0; i < count; i++)
     {
         Gem gem = new Gem(tile.DrawRectangle.Center.X, tile.DrawRectangle.Y - Main.Tilesize / 2, gemId);
         GameWorld.Instance.Entities.Add(gem);
     }
 }