package com.ady.timerunner;

import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input;
import com.badlogic.gdx.InputProcessor;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Animation;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import com.badlogic.gdx.math.Intersector;
import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.utils.Array;


public class TimeRunner extends ApplicationAdapter implements InputProcessor {
    private SpriteBatch batch;

    private World world;
    private Texture worldtext;
    private Texture particle0;
    private boolean started = false;
    private OrthographicCamera camera;
    private Array<PowerUp> powerups = new Array<PowerUp>();
    private Array<Cloud> clouds = new Array<Cloud>();
    //  private Array<PowerUp> powerupsremove = new Array<PowerUp>();
    private Array<Bullet> bullets = new Array<Bullet>();
    private Array<Bullet> bulletsremove = new Array<Bullet>();
    private Color color = new Color(Color.NAVY);
    private Array<Bubble> bubbles = new Array<Bubble>();
    private Array<Bubble> bubblesremove = new Array<Bubble>();
    private Array<Star> stars = new Array<Star>();
    private Array<Block> blocks = new Array<Block>();
    private Array<Block> blocksremove = new Array<Block>();
    private Array<Particle> particles = new Array<Particle>();
    private float change = 1f;
    private boolean menudiss = false;

    float angle = 0f;
    float oldangle = 0f;
    private Character character;
    private Array<FakeCharacter> fakes = new Array<FakeCharacter>();
    // private Array<FakeCharacter> fakesremove = new Array<FakeCharacter>();
    private Texture bullet;
    private Texture block;
    private Texture bubble;
    private ShapeRenderer shape;
    private float asd = 0;
    private float globalclock = 10;

    // Others  meteorit;
    private Texture starfront;
    private Texture starback;
    private float timechange = 0.01f;
    private Texture powerup0;
    private BitmapFont font;
    private SpriteBatch batch2;
    private OrthographicCamera camera2;
    private Texture[] cloudarray = new Texture[20];
    private Texture[] chararray = new Texture[9];
    private Texture mars;
    private float anglemars = 90f;
    private Texture gronia;
    private float elapsedTime;
    private Animation anim;

    @Override
    public void create() {
        font = new BitmapFont(Gdx.files.internal("fontall.fnt"));
        font.getRegion().getTexture().setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear);
        for (int i = 0; i < 80; i++) {
            particles.add(new Particle());
        }
        for (int i = 0; i < 9; i++) {
            chararray[i] = new Texture("char" + i + ".png");
            chararray[i].setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear);
        }


        anim = new Animation(0.16f, chararray);
        anim.setPlayMode(Animation.PlayMode.LOOP);

        camera = new OrthographicCamera(1920, 1080);
        camera.setToOrtho(false, 1920, 1080);
        camera2 = new OrthographicCamera(1920, 1080);
        camera2.setToOrtho(false, 1920, 1080);
        camera2.update();
        batch = new SpriteBatch();
        batch2 = new SpriteBatch();
        worldtext = new Texture("world.png");
        worldtext.setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear);
        Texture worldtext2 = new Texture("worldlayer2.png");
        worldtext2.setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear);

        particle0 = new Texture("particle0layer0.png");
        particle0.setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear);

        bullet = new Texture("bullet.png");
        bullet.setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear);

        bubble = new Texture("bubble.png");
        bubble.setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear);

        block = new Texture("block.png");
        block.setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear);

        mars = new Texture("mars.png");
        mars.setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear);

        gronia = new Texture("gronia.png");
        gronia.setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear);

        powerup0 = new Texture("powerup0.png");
        powerup0.setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear);

        cloudarray[0] = new Texture("cloud0.png");
        cloudarray[0].setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear);
        cloudarray[1] = new Texture("cloud1.png");
        cloudarray[1].setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear);
        cloudarray[2] = new Texture("cloud2.png");
        cloudarray[2].setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear);
        cloudarray[3] = new Texture("world2.png");
        cloudarray[3].setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear);
        starback = new Texture("starback.png");
        starback.setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear);
        starfront = new Texture("starfront.png");
        starfront.setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear);


        Texture charactertext = new Texture("char.png");
        charactertext.setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear);
        world = new World(worldtext, worldtext2, 8192f);
        world.changeCenter(10000, 0);
        character = new Character(charactertext, world);
        camera.zoom = 20f;
        camera.update();
        Gdx.input.setInputProcessor(this);

        GenerateBlocksArray();
        shape = new ShapeRenderer();
        for (int i = 0; i < 30000; i++) {
            stars.add(new Star(world, MathUtils.random(359.9f), MathUtils.random(26000)));
        }


        for (int i = 0; i < 12; i++) {
            clouds.add(new Cloud(world, MathUtils.random(359.9f), MathUtils.random(1000, 2000), MathUtils.random(2), MathUtils.random(0.7f, 0.9f), MathUtils.random(0.01f, 0.06f)));
        }

        clouds.add(new Cloud(world, MathUtils.random(359.9f), 12000, 3, 1, 0.1f));


//powerups.add(new PowerUp(world,angle,MathUtils.random(50,150), 0) );
    }

    @Override
    public void render() {
        elapsedTime += Gdx.graphics.getDeltaTime();
        // Gdx.gl.glClearColor(color.r,color.g,color.b,1);

        color.set(color.fromHsv(178 + (MathUtils.clamp(globalclock - 6, 3, 12) * 1.166f) * 4.83f, 1f - (MathUtils.clamp(globalclock - 6, 3, 12) * 1.116f) * 0.018f, 1f - ((MathUtils.clamp(globalclock - 6, 3, 12) * 1.333f) - 2f) * 0.05f));
        asd++;
        if (globalclock > 18 || globalclock < 0) {
            timechange *= -1;
        }
        globalclock += timechange;

        Gdx.gl.glClearColor(color.r, color.g, color.b, 1);
        Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);


        for (int k = 0; k < 1; k++) {

            angle += 0.3f;
            world.sprite.setRotation(angle);
            world.sprite2.setRotation(angle);
            world.sprite2.setAlpha(MathUtils.clamp(MathUtils.clamp(globalclock - 6, 0, 12) - 7f, 0f, 1f));
            batch.setProjectionMatrix(camera.combined);
            shape.setProjectionMatrix(camera.combined);
            batch2.setProjectionMatrix(camera2.combined);

            if (started) {
                if (Gdx.input.isKeyPressed(Input.Keys.RIGHT)) {
                    character.right();

                }
                if (Gdx.input.isKeyPressed(Input.Keys.LEFT)) {
                    character.left();

                }
                camera.zoom = 4 + 2*character.height / 540f;
                //   camera.zoom=5;
                camera.update();
            }
            batch.begin();

            //  batch.draw(meteor2,0,0);
            //  System.out.println(MathUtils.clamp(globalclock - 6, 0, 12));
            for (Star temp : stars) {
                temp.act(MathUtils.clamp(globalclock - 6, 0, 12), camera.zoom);

                if (temp.position.x > -(camera.zoom - 1) * 960 && temp.position.x < 1920 + (camera.zoom - 1) * 960 && temp.position.y > -(camera.zoom - 1) * 540 && temp.position.y < 1080 + (camera.zoom - 1) * 540 && temp.size / camera.zoom > 0.05f) {
                    //temp.color.a=temp.alpha;
                    //  batch.setColor(1,1,1,temp.alpha);
                    batch.setColor(temp.color);
                    batch.draw(starback, temp.position.x - temp.size * 12.5f, temp.position.y - temp.size * 12.5f, temp.size * 25, temp.size * 25);
                    batch.setColor(new Color(1f, 1f, 1f, temp.color.a));

                    batch.draw(starfront, temp.position.x - temp.size * 12.5f, temp.position.y - temp.size * 12.5f, temp.size * 25, temp.size * 25);
                }

            }


            // batch.setColor(color.cpy().lerp(Color.WHITE,0.1f));
            world.sprite.setColor(color.cpy().lerp(Color.WHITE, (1f - MathUtils.clamp(globalclock - 6, 0, 12) / 12f)));
            world.sprite.draw(batch);
            batch.setColor(Color.WHITE);
            if (globalclock > 7) {
                world.sprite2.draw(batch);
            }

            for (Bullet temp : bullets) {
                temp.act(bubbles);
                /*batch.end();
                shape.begin(ShapeRenderer.ShapeType.Line);
                //shape.rect(temp.position.x , temp.position.y , 400, 400);
                shape.setColor(Color.RED);
                shape.circle(temp.position.x, temp.position.y, 3);
                shape.setColor(Color.GREEN);
                shape.circle(temp.position.x + 25, temp.position.y + 25, 20);
                //shape.rect(0,0,50,50);
                shape.end();
                batch.begin();*/
                //batch.draw(bullet, temp.position.x, temp.position.y);
                batch.draw(bullet, temp.position.x, temp.position.y, 25, 25, 50f, 50f, 1f, 1f, temp.angle - (75 + temp.speed * 10), 0, 0, 50, 50, false, false);
                // System.out.println(temp.angle + "                    a");
                //System.out.println(temp.position.dst2(character.position));

                if (!temp.dead && Intersector.overlaps(temp.body, character.body)) {
                    bulletsremove.add(temp);
                    character.die();
                }
                for (int i = 0; i < blocks.size; i++) {
                    if (!temp.dead && !blocks.get(i).dead && temp.body.overlaps(blocks.get(i).body)) {

                        bulletsremove.add(temp);
                        blocks.get(i).dead = true;
                    }
                }


                if (temp.dead) {
                    bulletsremove.add(temp);
                }

            }
            batch.end();
            bullets.removeAll(bulletsremove, false);
            bulletsremove.clear();
            batch.begin();


            for (Bubble temp : bubbles) {
                temp.act();
                batch.setColor(new Color(1f, 1f, 1f, (1f / temp.size) - 0.4f));
                batch.draw(bubble, temp.getPosition().x - temp.size * 16, temp.getPosition().y - temp.size * 16, temp.size * 32, temp.size * 32);
                batch.setColor(Color.WHITE);
                if (temp.dead) {
                    bubblesremove.add(temp);
                }
            }
            batch.end();
            bubbles.removeAll(bubblesremove, false);
            bubblesremove.clear();


            //BLOCKS
            batch.begin();
            if (started) {
                for (Block temp : blocks) {
                    temp.act();
/*
                batch.end();
                shape.begin(ShapeRenderer.ShapeType.Line);
                //shape.rect(temp.position.x , temp.position.y , 400, 400);
                shape.setColor(Color.RED);
                shape.circle(temp.position.x, temp.position.y, 3);
                shape.setColor(Color.GREEN);
                Vector2 adder = new Vector2(5, 5);
                adder.setLength(64);
                adder.setAngle(temp.angle);
                adder.add(temp.position);
                shape.circle(adder.x, adder.y, 68);
                //shape.rect(0,0,50,50);
                shape.end();
                batch.begin();
*/
                    if (temp.dead) {
                        blocksremove.add(temp);
                    } else {
                        if (Intersector.overlaps(temp.body, character.body)) {
                            if (character.position.cpy().sub(world.center).len() - 30 < temp.position.cpy().sub(world.center).len()) {
                                blocksremove.add(temp);

                            } else {
                                character.jump = 0;
                                character.jump();
                            }
                        }
                        // batch.draw(bullet,temp.position.x,temp.position.y);
                        //      batch.setColor(color.cpy().lerp(Color.WHITE, (1f - MathUtils.clamp(globalclock - 6, 0, 12) / 25f)));
                        batch.setColor(temp.color.cpy().lerp(color, 0.5f));
                        batch.draw(block, temp.position.x - MathUtils.cosDeg(temp.angle - 90) * 64, temp.position.y - MathUtils.sinDeg(temp.angle - 90) * 64, 0, 0, 128f * 1.11f, 128f * 1.11f, 1f, 1f, temp.angle - 90, 0, 0, (int) (128 * 1.11), (int) (128 * 1.11), false, false);


                        //    batch.draw(bullet, temp.position.x, temp.position.y, 25, 25, 50f, 50f, 1f, 1f, temp.angle - (75 + temp.speed * 10), 0, 0, 50, 50, false, false);
                        //System.out.println(angle+"");
                    }
                }
            }
            blocks.removeAll(blocksremove, false);
            blocksremove.clear();
            batch.end();

            if (started) {
                batch.begin();
                for (FakeCharacter temp : fakes) {
                    temp.act(bullets);
                    batch.setColor(color.r,color.g,color.b,temp.alpha);
                    Texture currentFrame = (Texture) anim.getKeyFrame(temp.elapsedTime, true);
                    batch.draw(currentFrame, temp.sprite.getBoundingRectangle().x,  temp.sprite.getBoundingRectangle().y,0, 0  , 250, 250, 1f, 1f, temp.angle- 90, 0, 0, 250, 250, false, false);
                  //  temp.sprite.draw(batch);
                }
                batch.end();

                batch.begin();

////////////////KARAKTEEEEEEEEEEER////////
              //  character.sprite.draw(batch);
                Texture currentFrame = (Texture) anim.getKeyFrame(elapsedTime, true);

                batch.setColor(color.r,color.g,color.b,1);
                batch.draw(currentFrame, character.sprite.getBoundingRectangle().x,  character.sprite.getBoundingRectangle().y,0, 0  , 250, 250, 1f, 1f, character.angle- 90, 0, 0, 250, 250, false, false);
              //  batch.setColor(Color.WHITE);
                batch.setColor(Color.WHITE.cpy().lerp(Color.RED, character.bombsize));
                float bombsize = character.bombsize;
                batch.draw(bullet, character.position.x + MathUtils.random(-bombsize * 5, bombsize * 5) + MathUtils.cosDeg(character.angle) * 60, character.position.y + MathUtils.random(-bombsize * 5, bombsize * 5) + MathUtils.sinDeg(character.angle) * 60, 50 * (1 + bombsize), 50 * (1 + bombsize));
                //character.angle-=1f;
                batch.setColor(Color.WHITE);
                character.act(fakes);
                if (character.time > 1199) {
                    GenerateBlocks();
                }
                batch.end();


                batch.begin();
                for (PowerUp temp : powerups) {
                    temp.act();
                    batch.draw(powerup0, temp.position.x, temp.position.y);
                }
                batch.end();


                batch.begin();
                batch.setBlendFunction(GL20.GL_SRC_ALPHA, GL20.GL_ONE);
                for (Particle temp : particles) {
                    temp.act(angle + 90.6f, world.size - 50, 500, world.center);
                    Vector2 pos = temp.getposition();

                    // batch.setColor(Color.FOREST);
                    //  batch.draw(bullet,temp.position.x,temp.position.y);
                    // batch.setColor(Color.RED);
                    //  batch.draw(bullet,temp.position2.x,temp.position2.y);
                    //  batch.setColor(Color.BLUE);
                    //   batch.draw(bullet,pos.x,pos.y);

                    batch.setColor(temp.color);
                    // batch.setColor(Color.RED);

                    //  batch.draw(particle0,pos.x+MathUtils.random(-5f,5f),pos.y+MathUtils.random(-5f,5f),pos.x,pos.y,64,64, size,size,0,32,32,64,64,MathUtils.randomBoolean(),MathUtils.randomBoolean());
                    batch.draw(particle0, pos.x, pos.y, 39, 39, 78f, 78f, temp.size * 2, temp.size * 2, angle, 0, 0, 78, 78, MathUtils.randomBoolean(), MathUtils.randomBoolean());
                    batch.setColor(Color.WHITE);

                }
                batch.setBlendFunction(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);
                batch.end();

            }

            batch.begin();
            for (Cloud temp : clouds) {
                temp.act();

                float h = cloudarray[temp.type].getHeight();
                float w = cloudarray[temp.type].getWidth();
                batch.setColor(1f, 1f, 1f, temp.alpha);
                batch.draw(cloudarray[temp.type], temp.position.x, temp.position.y, w / 2f, h / 2f, w, h, 1f, 1f, temp.angle - 90, 0, 0, (int) w, (int) h, false, false);
            }
            batch.end();
        }
        if (!started) {
            batch2.begin();

            // batch2.draw(mars,150,150);
            anglemars += 0.2;

            batch2.setColor(color.cpy().lerp(Color.WHITE, (1f - MathUtils.clamp(globalclock - 6, 0, 12) / 12f)));
            if (menudiss) {
                batch2.setColor(1f, 1f, 1f, MathUtils.clamp((change - 0.8f) * 5f, 0, 1));
            }
            batch2.draw(mars, 700, 350, 248, 248, 496f, 496f, 0.3f, 0.3f, anglemars, 0, 0, 496, 496, false, false);
            batch2.draw(gronia, 450, 350, 277, 277, 554f, 554f, 0.1f, 0.1f, anglemars / 2, 0, 0, 554, 554, false, false);
            batch2.setColor(Color.WHITE);
            font.setColor(1f, 1f, 1f, MathUtils.clamp((change - 0.8f) * 5f, 0, 1));
            font.getData().setScale(1f);
            font.draw(batch2, "EARTH", 1320, 500);
            font.getData().setScale(0.7f);
            font.draw(batch2, "VENUS", 870, 700);
            font.getData().setScale(0.5f);
            font.draw(batch2, "(LOCKED)", 870, 600);
            font.getData().setScale(0.4f);
            font.draw(batch2, "GRONIA", 680, 690);
            font.getData().setScale(0.3f);
            font.draw(batch2, "(LOCKED)", 680, 635);

            font.getData().setScale(1.4f);
            font.draw(batch2, "NEW GAME", 50, 1200);
            font.draw(batch2, "OPTIONS", 50, 1000);
            font.draw(batch2, "EXIT", 50, 800);
            batch2.end();
            if (Gdx.input.isKeyJustPressed(Input.Keys.SPACE) && !menudiss) {
                menudiss = true;
                timechange *= 2;
                oldangle = angle;

            }
            if (menudiss) {
                if (change > 0f) {
                    change -= 0.0015f;

                    angle -= oldangle / 666.666;
                    angle -= 0.2;
                } else {
                    change = 0;
                    started = true;
                    timechange /= 2;
                }
                Vector2 a = new Vector2(960, -world.size / 2 + 250);
                Vector2 b = new Vector2(10000, 0);
                Vector2 c = new Vector2(5, 5);
                c.set(b.cpy().lerp(a, 1 - change));
                world.changeCenter(c.x, c.y);
                camera.zoom = 4 + 16 * change;
                camera.update();

            }
        }
    }


    private void GenerateBlocks() {
        int a = 0;
        while (a < 18) {
            a += MathUtils.random(4, 6);
            blocks.add(new Block(world, a * 20, (MathUtils.random(1) - 1) * 128 - 30));
        }
    }

    private void GenerateBlocksArray() {

        int[][] blockarr = new int[][]{
                {1, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {1, 1, 1, 0, 0, 0, 0, 0, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {1, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {1, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {1, 1, 0, 0, 0, 0, 0, 0, 0, 0},
                {0, 1, 1, 0, 0, 0, 0, 0, 0, 0},
                {0, 0, 1, 1, 0, 0, 0, 0, 0, 0},
                {0, 0, 0, 1, 1, 0, 0, 0, 0, 0},
                {0, 0, 0, 0, 1, 1, 0, 0, 0, 0},
                {0, 0, 0, 0, 0, 1, 1, 0, 0, 0},
                {1, 0, 0, 0, 0, 0, 1, 1, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 1, 1, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 1, 1},
                {1, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {1, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {1, 1, 1, 0, 0, 0, 0, 0, 0, 0},
                {1, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {1, 1, 0, 0, 0, 0, 0, 0, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {1, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {1, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {1, 1, 1, 1, 0, 0, 0, 0, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {1, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {1, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
                {1, 1, 1, 0, 0, 0, 0, 0, 0, 0}
        };
        for (int i = 0; i < 36; i++) {
            for (int j = 0; j < 10; j++) {
                if (blockarr[i][j] == 1) {
                    blocks.add(new Block(world, 60 - i * 10, (j - 1) * 128 + 64));
                }

            }
        }

    }


    @Override
    public void dispose() {
        batch.dispose();
        worldtext.dispose();

        starback.dispose();
        starfront.dispose();
        bubble.dispose();
        particle0.dispose();
        block.dispose();
    }

    @Override
    public boolean keyDown(int keycode) {
        if (started) {
            if (keycode == Input.Keys.UP) {
                //System.out.println("grdi");
                character.jump();
            }
            if (keycode == Input.Keys.SPACE) {
                character.shoot();
                bullets.add(new Bullet(world, character.angle, character.height + 30));
                character.bombsize = 0f;
                character.bombchange += 0.0001f;

            }
            if (keycode == Input.Keys.DOWN) {
                blocks.add(new Block(world, character.angle + 1.5f, character.height - 64));
            }
        }
        return false;
    }

    @Override
    public boolean keyUp(int keycode) {
        return false;
    }

    @Override
    public boolean keyTyped(char character) {

        return false;
    }

    @Override
    public boolean touchDown(int screenX, int screenY, int pointer, int button) {
        return false;
    }

    @Override
    public boolean touchUp(int screenX, int screenY, int pointer, int button) {
        return false;
    }

    @Override
    public boolean touchDragged(int screenX, int screenY, int pointer) {
        return false;
    }

    @Override
    public boolean mouseMoved(int screenX, int screenY) {
        return false;
    }

    @Override
    public boolean scrolled(int amount) {
        camera.zoom += (float) amount / 4f;
        camera2.zoom += (float) amount / 10f;
        camera.update();
        camera2.update();
        return false;
    }
}
