import uk.co.nickthecoder.tickle.action.movement.FollowMouse class Player : AbstractRole() { // Can test if two game objects are overlapping. val collisionDetection = PixelOverlapping( 300 ) override fun tick() { actor.stage.firstView().getMousePositionWorldBounded( actor.position ) for( other in actor.stage.actors) { if (collisionDetection.overlapping( actor, other )) { info( "You lose! Overlapping $other" ) actor.event( "collided" ) // makes an "ooh" sound. // actor.die() } } } }