class BouncyRock : Rock { var radius : double override fun begin() { super.begin() radius = actor.appearance.width() * 0.45 } override fun tick() { super.tick() for( otherA in actor.stage.actors ) { if ( otherA.role !is BouncyRock) continue val other = otherA.role as BouncyRock if (other != this && other != null && clan == other.clan ) { if ( CircularCollision.overlapping( radius + other.radius, actor.position, other.actor.position ) ) { val hit = CircularCollision.collision(actor.position, velocity, 1, other.actor.position, other.velocity, 1) if ( hit > 0 ) { actor.event("bounce") rotation += hit other.rotation -= hit } } } } } }