/* A number of icons appears on the "glass" stage, to indicate how many more resources are needed to complete the scene. */ class CargoIcon : ActionRole() { var index = 0 var line = 0 override fun begin() { val height = Play.instance.glassView.worldHeight actor.x = -40 - index * 40 actor.y = height -50 - line * 40 super.begin() } fun remove() { replaceAction( MoveBy( actor.position, 0.5, Vector2( -Play.instance.glassView.worldWidth, 0 ), Eases.easeInQuad ) .and( Fade( actor.color, 0.5, 0 ) ) .then( Kill( actor ) ) ) } override fun createAction() : Action { val width = Play.instance.glassView.worldWidth return Delay( index * 0.2 + line * 0.45 ) .then( MoveBy( actor.position, 1, Vector2(width, 0 ), Eases.easeOutQuad ) ) } }