public void Initialize(Texture2D _texture) { texture = _texture; for (int ih = 0; ih < tilesHigh; ih++) { for (int iw = 0; iw < tilesWide; iw++) { int tilePos = iw + (ih * tilesWide); TilesetTile t = new TilesetTile(tilePos); tiles.Add(t); } } }
public bool IsTileSolid(int x, int y, int side) { foreach (int i in new int[] { bottomLayer[x, y], middleLayer[x, y], topLayer[x, y] }) { if (i == -1) { continue; } TilesetTile t = tileset.GetTilesetTile(i); if (t == null) { continue; } TileSolidInfo tsi = t.solid; if (tsi == null) { continue; } if (tsi.Left && side == Directions.LEFT) { return(true); } else if (tsi.Top && side == Directions.UP) { return(true); } else if (tsi.Right && side == Directions.RIGHT) { return(true); } else if (tsi.Bottom && side == Directions.DOWN) { return(true); } } return(false); }