public BackgroundTile(Int32 column, Int32 row, BackgroundTileData data) { Column = column; Row = row; AssetIndexColumn = data.AssetIndexColumn; AssetIndexRow = data.AssetIndexRow; AssetIndex = new Vector2i(data.AssetIndexColumn, data.AssetIndexRow); Passable = data.Passable; Friction = data.Friction; }
public override BackgroundTileData GetBackgroundTileData(Int32 column, Int32 row) { if (column < 0 || column >= BackgroundTileColumns) throw new ArgumentOutOfRangeException(); if (row < 0 || row >= BackgroundTileRows) throw new ArgumentOutOfRangeException(); Int32 assetCol = 1; Int32 assetRow = 0; if (column == 3 && row == 1) { assetCol = 3; assetRow = 0; } else if (column == 0 || column == BackgroundTileColumns - 1 || column == 15) { assetCol = 2; assetRow = 0; } else if (column % 2 == 0 && row == 0) { assetCol = 2; assetRow = 0; } else if (column % 2 != 0 && row == BackgroundTileRows - 1) { assetCol = 2; assetRow = 0; } BackgroundTileData data = new BackgroundTileData(assetCol, assetRow); return data; }