// Path: components/src/net/mostlyoriginal/game/component/G.java
// public class G {
// 
//     public static final int LOGO_WIDTH = 280;
//     public static final int LOGO_HEIGHT = 221;
//     public static final int LAYER_CURSOR = 2000;
// 
//     public static final boolean PRODUCTION = false;
// 
//     public static final boolean INTERLACING_SIMULATION = true;
// 
//     public static final boolean DEBUG_SKIP_INTRO = (!PRODUCTION && false);
//     public static final boolean DEBUG_ACHIEVEMENTS = (!PRODUCTION && false);
//     public static final boolean DEBUG_DRAWING = (!PRODUCTION && true);
//     public static final boolean DEBUG_NO_MUSIC =(!PRODUCTION && false);
//     public static final boolean DEBUG_NO_ENTITY_RENDERING =(!PRODUCTION && false);
//     public static final boolean DEBUG_NO_SECOND_PASS  =(!PRODUCTION && false);
//     public static final boolean DEBUG_NO_ACHIEVEMENTS  = (!PRODUCTION && true);
//     public static boolean DEBUG_NO_FLOW = (!PRODUCTION && false);
//     public static boolean DEBUG_AIR_PLANET = (!PRODUCTION && false);
//     public static boolean DEBUG_NAIVE_GRAVITY = (!PRODUCTION && false);
//     public static boolean DEBUG_NO_CARDS = (!PRODUCTION && true);
// 
//     public static final float CARD_X = 5;
//     public static final float CARD_Y = 5;
// 
// 
//     public static final int SIMULATION_WIDTH = 220 + 50;
//     public static final int SIMULATION_HEIGHT = 220 + 50;
//     public static final int MARGIN_BETWEEN_CARDS = 5;
// 
//     public static final int LAYER_STAR = -50;
//     public static final int LAYER_STRUCTURES_BACKGROUND = -2;
//     public static final int LAYER_PLANET = 0;
//     public static final int LAYER_DUDES = 99;
//     public static final int LAYER_GHOST = 100;
//     public static final int LAYER_CARDS = 1000;
//     public static final int LAYER_CARDS_HOVER = 1001;
//     public static final int LAYER_CARDS_FLYING = 1002;
//     public static final int LAYER_ACHIEVEMENTS = 900;
//     public static final int LAYER_STRUCTURES = -1;
//     public static final int LAYER_STRUCTURES_FOREGROUND = 101;
// 
//     public static int CAMERA_ZOOM = 2;
//     public static final int SCREEN_WIDTH = SIMULATION_WIDTH * 2 * CAMERA_ZOOM;
//     private static int CARD_HEIGHT = 90;
//     private static int MARGIN_BETWEEN_CARD_AND_SIM = 10;
// 
//     public static int PLANET_X = (SIMULATION_WIDTH) - (SIMULATION_WIDTH / 2);
//     public static int PLANET_Y = MARGIN_BETWEEN_CARD_AND_SIM + CARD_HEIGHT;
//     private static final int MARGIN_BETWEEN_SIM_AND_ROOF = 20;
//     public static final int SCREEN_HEIGHT = (SIMULATION_HEIGHT + CARD_HEIGHT + MARGIN_BETWEEN_CARD_AND_SIM + MARGIN_BETWEEN_SIM_AND_ROOF) * CAMERA_ZOOM;
// 
//     public static final int PLANET_CENTER_X = PLANET_X + (SIMULATION_WIDTH / 2);
//     public static final int PLANET_CENTER_Y = PLANET_Y + (SIMULATION_HEIGHT / 2);
// 
//     public static final int GRADIENT_SCALE = 5;
//     public static float TOOL_HEIGHT = 50;
// }
// 
// Path: components/src/net/mostlyoriginal/game/component/Star.java
// public class Star extends Component {
//     public Star() {
//     }
//     public final String animId[] = new String[6];
//     public final float speedFactor = 1f + MathUtils.random(-0.2f,0.5f);
//     public float blinkTimer = MathUtils.random(0f,10f);
// 
//     public void set(int kind) {
//         animId[0] = "star-" + kind + "-0";
//         animId[1] = "star-" + kind + "-1";
//         animId[2] = "star-" + kind + "-2";
//         animId[3] = "star-" + kind + "-3";
//         animId[4] = "star-" + kind + "-4";
//         animId[5] = "star-" + kind + "-5";
//     }
// }
// 
// Path: core/src/net/mostlyoriginal/game/system/common/FluidIteratingSystem.java
// public abstract class FluidIteratingSystem extends IteratingSystem {
// 
//     public FluidIteratingSystem(Aspect.Builder aspect) {
//         super(aspect);
//     }
// 
//     @Override
//     protected void process(int id) {
//         process(E(id));
//     }
// 
//     protected abstract void process(E e);
// 
// 
//     protected EBag allEntitiesMatching(Aspect.Builder scope) {
//         return new EBag(world.getAspectSubscriptionManager().get(scope).getEntities());
//     }
// 
//     protected EBag allEntitiesWith(Class<? extends Component> scope) {
//         return new EBag(world.getAspectSubscriptionManager().get(Aspect.all(scope)).getEntities());
//     }
// }


import com.artemis.Aspect;
import com.artemis.ComponentMapper;
import com.artemis.E;
import com.badlogic.gdx.math.Interpolation;
import com.badlogic.gdx.math.MathUtils;
import net.mostlyoriginal.api.component.basic.Pos;
import net.mostlyoriginal.api.component.graphics.Anim;
import net.mostlyoriginal.game.component.G;
import net.mostlyoriginal.game.component.Star;
import net.mostlyoriginal.game.system.common.FluidIteratingSystem;
import static com.artemis.E.E;


    private void trustEffect() {

        // work towards full thrust.
        if (active) {
            timer += world.delta * 0.25f;
            timer = MathUtils.clamp(timer, 0f, 1f);
            speedFactor = Interpolation.exp5.apply(timer * 0.6f);
            if (playSoundState == 0) {
                playSoundState = 1;
            }
        } else {
            timer -= world.delta * 0.25f;
            timer = MathUtils.clamp(timer, 0f, 1f);
            speedFactor = Interpolation.exp5.apply(timer * 0.6f);
            if (playSoundState == 1) {
                playSoundState = 0;
            }
        }

    }

    @Override
    protected void begin() {
        super.begin();
        trustEffect();

        if (speedFactor > 0.5) {
            animStage = 3;
// Path: components/src/net/mostlyoriginal/game/component/G.java
// public class G {
// 
//     public static final int LOGO_WIDTH = 280;
//     public static final int LOGO_HEIGHT = 221;
//     public static final int LAYER_CURSOR = 2000;
// 
//     public static final boolean PRODUCTION = false;
// 
//     public static final boolean INTERLACING_SIMULATION = true;
// 
//     public static final boolean DEBUG_SKIP_INTRO = (!PRODUCTION && false);
//     public static final boolean DEBUG_ACHIEVEMENTS = (!PRODUCTION && false);
//     public static final boolean DEBUG_DRAWING = (!PRODUCTION && true);
//     public static final boolean DEBUG_NO_MUSIC =(!PRODUCTION && false);
//     public static final boolean DEBUG_NO_ENTITY_RENDERING =(!PRODUCTION && false);
//     public static final boolean DEBUG_NO_SECOND_PASS  =(!PRODUCTION && false);
//     public static final boolean DEBUG_NO_ACHIEVEMENTS  = (!PRODUCTION && true);
//     public static boolean DEBUG_NO_FLOW = (!PRODUCTION && false);
//     public static boolean DEBUG_AIR_PLANET = (!PRODUCTION && false);
//     public static boolean DEBUG_NAIVE_GRAVITY = (!PRODUCTION && false);
//     public static boolean DEBUG_NO_CARDS = (!PRODUCTION && true);
// 
//     public static final float CARD_X = 5;
//     public static final float CARD_Y = 5;
// 
// 
//     public static final int SIMULATION_WIDTH = 220 + 50;
//     public static final int SIMULATION_HEIGHT = 220 + 50;
//     public static final int MARGIN_BETWEEN_CARDS = 5;
// 
//     public static final int LAYER_STAR = -50;
//     public static final int LAYER_STRUCTURES_BACKGROUND = -2;
//     public static final int LAYER_PLANET = 0;
//     public static final int LAYER_DUDES = 99;
//     public static final int LAYER_GHOST = 100;
//     public static final int LAYER_CARDS = 1000;
//     public static final int LAYER_CARDS_HOVER = 1001;
//     public static final int LAYER_CARDS_FLYING = 1002;
//     public static final int LAYER_ACHIEVEMENTS = 900;
//     public static final int LAYER_STRUCTURES = -1;
//     public static final int LAYER_STRUCTURES_FOREGROUND = 101;
// 
//     public static int CAMERA_ZOOM = 2;
//     public static final int SCREEN_WIDTH = SIMULATION_WIDTH * 2 * CAMERA_ZOOM;
//     private static int CARD_HEIGHT = 90;
//     private static int MARGIN_BETWEEN_CARD_AND_SIM = 10;
// 
//     public static int PLANET_X = (SIMULATION_WIDTH) - (SIMULATION_WIDTH / 2);
//     public static int PLANET_Y = MARGIN_BETWEEN_CARD_AND_SIM + CARD_HEIGHT;
//     private static final int MARGIN_BETWEEN_SIM_AND_ROOF = 20;
//     public static final int SCREEN_HEIGHT = (SIMULATION_HEIGHT + CARD_HEIGHT + MARGIN_BETWEEN_CARD_AND_SIM + MARGIN_BETWEEN_SIM_AND_ROOF) * CAMERA_ZOOM;
// 
//     public static final int PLANET_CENTER_X = PLANET_X + (SIMULATION_WIDTH / 2);
//     public static final int PLANET_CENTER_Y = PLANET_Y + (SIMULATION_HEIGHT / 2);
// 
//     public static final int GRADIENT_SCALE = 5;
//     public static float TOOL_HEIGHT = 50;
// }
// 
// Path: components/src/net/mostlyoriginal/game/component/Star.java
// public class Star extends Component {
//     public Star() {
//     }
//     public final String animId[] = new String[6];
//     public final float speedFactor = 1f + MathUtils.random(-0.2f,0.5f);
//     public float blinkTimer = MathUtils.random(0f,10f);
// 
//     public void set(int kind) {
//         animId[0] = "star-" + kind + "-0";
//         animId[1] = "star-" + kind + "-1";
//         animId[2] = "star-" + kind + "-2";
//         animId[3] = "star-" + kind + "-3";
//         animId[4] = "star-" + kind + "-4";
//         animId[5] = "star-" + kind + "-5";
//     }
// }
// 
// Path: core/src/net/mostlyoriginal/game/system/common/FluidIteratingSystem.java
// public abstract class FluidIteratingSystem extends IteratingSystem {
// 
//     public FluidIteratingSystem(Aspect.Builder aspect) {
//         super(aspect);
//     }
// 
//     @Override
//     protected void process(int id) {
//         process(E(id));
//     }
// 
//     protected abstract void process(E e);
// 
// 
//     protected EBag allEntitiesMatching(Aspect.Builder scope) {
//         return new EBag(world.getAspectSubscriptionManager().get(scope).getEntities());
//     }
// 
//     protected EBag allEntitiesWith(Class<? extends Component> scope) {
//         return new EBag(world.getAspectSubscriptionManager().get(Aspect.all(scope)).getEntities());
//     }
// }


// Path: core/src/net/mostlyoriginal/game/system/StarEffectSystem.java
import com.artemis.Aspect;
import com.artemis.ComponentMapper;
import com.artemis.E;
import com.badlogic.gdx.math.Interpolation;
import com.badlogic.gdx.math.MathUtils;
import net.mostlyoriginal.api.component.basic.Pos;
import net.mostlyoriginal.api.component.graphics.Anim;
import net.mostlyoriginal.game.component.G;
import net.mostlyoriginal.game.component.Star;
import net.mostlyoriginal.game.system.common.FluidIteratingSystem;
import static com.artemis.E.E;



    private void trustEffect() {

        // work towards full thrust.
        if (active) {
            timer += world.delta * 0.25f;
            timer = MathUtils.clamp(timer, 0f, 1f);
            speedFactor = Interpolation.exp5.apply(timer * 0.6f);
            if (playSoundState == 0) {
                playSoundState = 1;
            }
        } else {
            timer -= world.delta * 0.25f;
            timer = MathUtils.clamp(timer, 0f, 1f);
            speedFactor = Interpolation.exp5.apply(timer * 0.6f);
            if (playSoundState == 1) {
                playSoundState = 0;
            }
        }

    }

    @Override
    protected void begin() {
        super.begin();
        trustEffect();

        if (speedFactor > 0.5) {
            animStage = 3;
        } else if (speedFactor > 0.25) {