Skip to content

Commit

Permalink
simplify createTile
Browse files Browse the repository at this point in the history
  • Loading branch information
Geokureli committed May 30, 2024
1 parent 1d7452a commit 0dcc4ad
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions flixel/tile/FlxTilemap.hx
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,10 @@ class FlxTilemap extends FlxTypedTilemap<FlxTile>
super();
}

override function createTile(index, width, height, visible, allowCollisions):FlxTile
override function createTile(index:Int, width, height):FlxTile
{
final visible = index >= _drawIndex;
final allowCollisions = index >= _collideIndex ? this.allowCollisions : NONE;
return new FlxTile(this, index, width, height, visible, allowCollisions);
}
}
Expand Down Expand Up @@ -380,7 +382,7 @@ class FlxTypedTilemap<Tile:FlxTile> extends FlxBaseTilemap<Tile>
length += _startingIndex;

for (i in 0...length)
_tileObjects[i] = createTile(i, tileWidth, tileHeight, (i >= _drawIndex), (i >= _collideIndex) ? allowCollisions : NONE);
_tileObjects[i] = createTile(i, tileWidth, tileHeight);

// Create debug tiles for rendering bounding boxes on demand
#if FLX_DEBUG
Expand All @@ -390,7 +392,7 @@ class FlxTypedTilemap<Tile:FlxTile> extends FlxBaseTilemap<Tile>
#end
}

function createTile(index, width, height, visible, allowCollisions):Tile
function createTile(index, width, height):Tile
{
throw "createTile not implemented";
}
Expand Down

0 comments on commit 0dcc4ad

Please sign in to comment.