Skip to content

Instantly share code, notes, and snippets.

@migimunz
Created August 3, 2012 19:19
Show Gist options
  • Save migimunz/3250590 to your computer and use it in GitHub Desktop.
Save migimunz/3250590 to your computer and use it in GitHub Desktop.
the int problem
/* ... */
class TilemapIterator
{
private var tilemap:FlxTilemap;
private var curX:Int;
private var curY:Int;
private var endX:Int;
private var endY:Int;
public function new(tilemap:FlxTilemap, x1:Int, y1:Int, x2:Int, y2:Int)
{
this.tilemap = tilemap;
this.curX = tilemap.clampX(cast(Math.min(x1, x2), Int));
this.curY = tilemap.clampY(cast(Math.min(y1, y2), Int));
this.endX = tilemap.clampX(cast(Math.max(x1, x2), Int));
this.endY = tilemap.clampY(cast(Math.max(y1, y2), Int));
}
/* ... */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment