class Shrapnel : ActionRole { @CostumeAttribute var offset : Vector2 var parent : Actor val velocity = Vector2() val g = Vector2( 0, -100 ) fun explode( parent : Actor ) { this.parent = parent actor.scale.set( parent.scale ) offset *= actor.scale velocity.set( offset ) velocity *= 5 replaceAction( Follow( actor.position, parent.position, offset ) and // Actually this adds a velocity to the position! Accelerate( offset, velocity ) and // This one IS actually an acceleration! Accelerate( velocity, g ) and Turn( actor.direction, if (offset.x < 0) 180 else -180 ) ) } }