class Shrapnel : ActionRole { override fun createAction() : Action { val offset = Polar2d( Angle.degrees( Rand.randomDouble(360) ), Rand.randomDouble( 300 ) ).vector() val duration = Rand.between( 0.8, 1.2 ) return ( MoveBy( actor.position, duration, offset ) and Fade( actor.color, duration, 0 ) //, Eases.easeOut ) ) then Kill( actor ) } }