Exemple #1
0
 static void PutEmpty(int x, int y)
 {
     if (empty == null)
     {
         Game1.getLocationFromName("farm").removeEverythingFromThisTile(x, y);
         empty = Game1.getLocationFromName("farm").getObjectAt(x, y);
         return;
     }
     if (empty == Game1.getLocationFromName("farm").getObjectAt(x, y))
     {
         return;
     }
     Game1.getLocationFromName("farm").setObjectAt(x, y, empty);
 }
Exemple #2
0
        private void InitBoard()
        {
            if (brick == null)
            {
                brick = new StardewValleyObject(75, 1, false, -1, 0);
            }

            for (int y = boardY; y < boardY + 22; y++)
            {
                for (int x = boardX; x < boardX + 12; x++)
                {
                    PutEmpty(x, y);
                }
                //Monitor.Log($"y좌표 : {y} 타일 인덱스 합 : {sum}", LogLevel.Debug);
            }
            Game1.getLocationFromName("farm").setMapTileIndex(boardX, boardY + 21, 0, "Front");
            Game1.getLocationFromName("farm").setMapTileIndex(boardX, boardY, 1, "Front");
            Game1.getLocationFromName("farm").setMapTileIndex(boardX + 11, boardY, 2, "Front");
            Game1.getLocationFromName("farm").setMapTileIndex(boardX + 11, boardY + 21, 3, "Front");
            for (int x = boardX + 1; x < boardX + 11; x++)
            {
                Game1.getLocationFromName("farm").setMapTileIndex(x, boardY, 5, "Front");
            }
            for (int x = boardX + 1; x < boardX + 11; x++)
            {
                Game1.getLocationFromName("farm").setMapTileIndex(x, boardY + 21, 5, "Front");
            }
            for (int y = boardY + 1; y < boardY + 21; y++)
            {
                Game1.getLocationFromName("farm").setMapTileIndex(boardX, y, 6, "Front");
            }
            for (int y = boardY + 1; y < boardY + 21; y++)
            {
                Game1.getLocationFromName("farm").setMapTileIndex(boardX + 11, y, 6, "Front");
            }
        }