Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions net/flashpunk/World.as
Original file line number Diff line number Diff line change
Expand Up @@ -995,6 +995,31 @@
}
}

/**
* Returns the Entity at front which collides with the point.
* @param x X position
* @param y Y position
* @return The Entity at front which collides with the point, or null if not found.
*/
public function frontCollidePoint(x:Number, y:Number):Entity
{
var e:Entity,
i:int = 0,
l:int = _layerList.length;
do
{
e = _renderFirst[_layerList[i]];
while (e)
{
if(e.collidePoint(e.x, e.y, x, y)) return e;
e = e._renderNext
}
if(i > l) break;
}
while(++i);
return null;
}

/** @private Adds Entity to the update list. */
private function addUpdate(e:Entity):void
{
Expand Down