// Path: wisper-libgdx/core/src/java/fr/wisper/utils/Config.java
// public class Config {
//     public static final String GAME_NAME = "Wisper";
//     public static final String GAME_VERSION = "v0.1";
//     public static final int APP_WIDTH = 1280;
//     public static final int APP_HEIGHT = 768;
//     public static final String DEFAULT_SAVE_FOLDER = Config.GAME_NAME + "/saves";
//     public static final float ANIMATION_DURATION = 1.5f;
//     public static final float WISPER_SPEED = 150;
//     public static final float DOUBLE_TAP_INTERVAL = 500f;
//     public static final float WISPER_DASH_DISTANCE = 300f;
//     public static final float WISPER_DASH_DURATION = 0.25f;
//     public static final float WISPER_DASH_TIMEOUT = 2f;
//     public static final long WISPER_TIME_BETWEEN_ANIMATIONS = 8000;
//     public static final long WISPER_TIME_FIRST_ANIMATIONS = 3000;
//     public static final float GAME_RATIO = 0.1f;
//     public static final float BOX2D_WISPER_MOVE_FORCE = 500f;
//     public static final float BOX2D_WISPER_MOVE_DAMPING = 15f;
//     public static final float BOX2D_WISPER_DASH_FORCE = 50000f;
//     public static final float BOX2D_WISPER_DASH_DAMPING = 3.5f;
//     public static final float BOX2D_WISPER_DASH_TIME = 0.35f;
// 
//     public static boolean isAndroid() {
//         return (Gdx.app.getType() == Application.ApplicationType.Android);
//     }
// 
//     public static Vector2 getProjectedCoordinates(int screenX, int screenY, Viewport viewport) {
//         Vector2 touchPos = new Vector2(screenX, screenY);
//         //touchPos = getCamera().unproject(touchPos);
//         float xRatio = (float) Config.APP_WIDTH / (float) viewport.getViewportWidth();
//         float yRatio = (float) Config.APP_HEIGHT / (float) viewport.getViewportHeight();
// 
//         touchPos.x -= (Gdx.graphics.getWidth() - viewport.getViewportWidth()) / 2;
//         touchPos.x *= xRatio;
// 
//         touchPos.y = Gdx.graphics.getHeight() - touchPos.y;
//         touchPos.y -= (Gdx.graphics.getHeight() - viewport.getViewportHeight()) / 2;
//         touchPos.y *= yRatio;
// 
//         return touchPos;
//     }
// }


import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.physics.box2d.*;
import fr.wisper.utils.Config;
package fr.wisper.entities;


public class BulletBox2d extends AbstractBox2dWrapper {
    // Wisper
    private Bullet bullet;

    public BulletBox2d(int particleId, World world) {
        switch (particleId) {
            case Bullet.BLACK_BULLET:
                bullet = new Bullet("particles/black-bullet-small-noadditive.p");
                break;
            case Bullet.BLUE_BULLET:
                bullet = new Bullet("particles/blue-bullet-small-noadditive.p");
                break;
            case Bullet.RED_BULLET:
                bullet = new Bullet("particles/red-bullet-small-noadditive.p");
                break;
            default:
                break;
        }

        body = createBulletBody(world);
        body.setBullet(true);
    }

    @Override
    public void draw(Batch batch, float delta) {
        bullet.setPosition(body.getPosition().x - bullet.getOffset() / 2, body.getPosition().y);
        bullet.draw(batch, delta);
    }

    private Body createBulletBody(World world) {
        CircleShape shape = new CircleShape();
        shape.setRadius(1f); // Meters

        BodyDef wisperBodyDef = new BodyDef();
        wisperBodyDef.type = BodyDef.BodyType.DynamicBody;
// Path: wisper-libgdx/core/src/java/fr/wisper/utils/Config.java
// public class Config {
//     public static final String GAME_NAME = "Wisper";
//     public static final String GAME_VERSION = "v0.1";
//     public static final int APP_WIDTH = 1280;
//     public static final int APP_HEIGHT = 768;
//     public static final String DEFAULT_SAVE_FOLDER = Config.GAME_NAME + "/saves";
//     public static final float ANIMATION_DURATION = 1.5f;
//     public static final float WISPER_SPEED = 150;
//     public static final float DOUBLE_TAP_INTERVAL = 500f;
//     public static final float WISPER_DASH_DISTANCE = 300f;
//     public static final float WISPER_DASH_DURATION = 0.25f;
//     public static final float WISPER_DASH_TIMEOUT = 2f;
//     public static final long WISPER_TIME_BETWEEN_ANIMATIONS = 8000;
//     public static final long WISPER_TIME_FIRST_ANIMATIONS = 3000;
//     public static final float GAME_RATIO = 0.1f;
//     public static final float BOX2D_WISPER_MOVE_FORCE = 500f;
//     public static final float BOX2D_WISPER_MOVE_DAMPING = 15f;
//     public static final float BOX2D_WISPER_DASH_FORCE = 50000f;
//     public static final float BOX2D_WISPER_DASH_DAMPING = 3.5f;
//     public static final float BOX2D_WISPER_DASH_TIME = 0.35f;
// 
//     public static boolean isAndroid() {
//         return (Gdx.app.getType() == Application.ApplicationType.Android);
//     }
// 
//     public static Vector2 getProjectedCoordinates(int screenX, int screenY, Viewport viewport) {
//         Vector2 touchPos = new Vector2(screenX, screenY);
//         //touchPos = getCamera().unproject(touchPos);
//         float xRatio = (float) Config.APP_WIDTH / (float) viewport.getViewportWidth();
//         float yRatio = (float) Config.APP_HEIGHT / (float) viewport.getViewportHeight();
// 
//         touchPos.x -= (Gdx.graphics.getWidth() - viewport.getViewportWidth()) / 2;
//         touchPos.x *= xRatio;
// 
//         touchPos.y = Gdx.graphics.getHeight() - touchPos.y;
//         touchPos.y -= (Gdx.graphics.getHeight() - viewport.getViewportHeight()) / 2;
//         touchPos.y *= yRatio;
// 
//         return touchPos;
//     }
// }


// Path: wisper-libgdx/core/src/java/fr/wisper/entities/BulletBox2d.java
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.physics.box2d.*;
import fr.wisper.utils.Config;

package fr.wisper.entities;


public class BulletBox2d extends AbstractBox2dWrapper {
    // Wisper
    private Bullet bullet;

    public BulletBox2d(int particleId, World world) {
        switch (particleId) {
            case Bullet.BLACK_BULLET:
                bullet = new Bullet("particles/black-bullet-small-noadditive.p");
                break;
            case Bullet.BLUE_BULLET:
                bullet = new Bullet("particles/blue-bullet-small-noadditive.p");
                break;
            case Bullet.RED_BULLET:
                bullet = new Bullet("particles/red-bullet-small-noadditive.p");
                break;
            default:
                break;
        }

        body = createBulletBody(world);
        body.setBullet(true);
    }

    @Override
    public void draw(Batch batch, float delta) {
        bullet.setPosition(body.getPosition().x - bullet.getOffset() / 2, body.getPosition().y);
        bullet.draw(batch, delta);
    }

    private Body createBulletBody(World world) {
        CircleShape shape = new CircleShape();
        shape.setRadius(1f); // Meters

        BodyDef wisperBodyDef = new BodyDef();
        wisperBodyDef.type = BodyDef.BodyType.DynamicBody;
        wisperBodyDef.position.set(Config.APP_WIDTH / 2, Config.APP_HEIGHT / 2);