示例#1
0
 public static void setMapTileIndexIfOnTileSheet(Map map, int x, int y, int index, string layer, int tileSheetToMatch)
 {
     if (SheetHelper.isTileOnSheet(map, layer, x, y, tileSheetToMatch))
     {
         map.GetLayer(layer).Tiles[x, y].TileIndex = index;
     }
 }
示例#2
0
        public static int getFloorSpriteIndex(Map map, int x, int y)
        {
            int index = -1;

            if (SheetHelper.isTileOnSheet(map, "Back", x, y, SheetHelper.getTileSheet(map, "walls_and_floors"), new Rectangle(0, 21, 16, 20)))
            {
                index = map.GetLayer("Back").Tiles[x, y].TileIndex;
            }
            return(index);
        }
示例#3
0
        public static int getWallSpriteIndex(Map map, int x, int y)
        {
            int index = -1;

            if (SheetHelper.isTileOnSheet(map, "Back", x, y, SheetHelper.getTileSheet(map, "walls_and_floors"), new Rectangle(0, 0, 16, 21)))
            {
                index = map.GetLayer("Back").Tiles[x, y].TileIndex;
            }
            else if (SheetHelper.isTileOnSheet(map, "Buildings", x, y, SheetHelper.getTileSheet(map, "walls_and_floors"), new Rectangle(0, 0, 16, 21)))
            {
                index = map.GetLayer("Buildings").Tiles[x, y].TileIndex;
            }
            else if (SheetHelper.isTileOnSheet(map, "Front", x, y, SheetHelper.getTileSheet(map, "walls_and_floors"), new Rectangle(0, 0, 16, 21)))
            {
                index = map.GetLayer("Front").Tiles[x, y].TileIndex;
            }
            return(index);
        }