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; } }
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); }
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); }
internal static void setMapTileIndexesInSquare(Map map, Rectangle floor, int x, int y, int index) { if (floor.Contains(x, y)) { setMapTileIndexIfOnTileSheet(map, x, y, index, "Back", SheetHelper.getTileSheet(map, "walls_and_floors"), new Rectangle(0, 21, 16, 10)); } if (floor.Contains(x + 1, y)) { setMapTileIndexIfOnTileSheet(map, x + 1, y, index + 1, "Back", SheetHelper.getTileSheet(map, "walls_and_floors"), new Rectangle(0, 21, 16, 10)); } if (floor.Contains(x, y + 1)) { setMapTileIndexIfOnTileSheet(map, x, y + 1, index + 16, "Back", SheetHelper.getTileSheet(map, "walls_and_floors"), new Rectangle(0, 21, 16, 10)); } if (floor.Contains(x + 1, y + 1)) { setMapTileIndexIfOnTileSheet(map, x + 1, y + 1, index + 17, "Back", SheetHelper.getTileSheet(map, "walls_and_floors"), new Rectangle(0, 21, 16, 10)); } }
internal static void setFloorMapTileIndexForAnyLayer(Map map, int x, int y, int index) { setMapTileIndexIfOnTileSheet(map, x, y, getFloorIndex(map, x, y, "Back", index), "Back", SheetHelper.getTileSheet(map, "walls_and_floors"), new Rectangle(0, 21, 16, 10)); setMapTileIndexIfOnTileSheet(map, x, y, getFloorIndex(map, x, y, "Buildings", index), "Buildings", SheetHelper.getTileSheet(map, "walls_and_floors"), new Rectangle(0, 21, 16, 10)); setMapTileIndexIfOnTileSheet(map, x, y, getFloorIndex(map, x, y, "Front", index), "Front", SheetHelper.getTileSheet(map, "walls_and_floors"), new Rectangle(0, 21, 16, 10)); }