package com.pqbyte.coherence;

import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.physics.box2d.World;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.utils.viewport.ExtendViewport;

public class TheGame2 extends ApplicationAdapter {
  private static final float VIEWPORT_WIDTH = 30;

  private Stage stage;
  private World world;

  @Override
  public void create() {
    world = new World(new Vector2(0, 0), true);

    Map map = new Map(
        new Texture(Gdx.files.internal("wallpaper.jpg")),
        Constants.WORLD_WIDTH,
        Constants.WORLD_HEIGHT,
        world
    );

    Player player = new Player(
        new Texture(Gdx.files.internal("cube128.png")),
        0,
        0,
        world
    );
    player.addListener(new MoveListener(player));

    float screenWidth = Gdx.graphics.getWidth();
    float screenHeight = Gdx.graphics.getHeight();

    stage = new Stage(new ExtendViewport(
        VIEWPORT_WIDTH, VIEWPORT_WIDTH * (screenHeight / screenWidth)));
    stage.addActor(map);
    stage.addActor(player);
    stage.setKeyboardFocus(player);

    Gdx.input.setInputProcessor(stage);
  }

  @Override
  public void dispose() {
    stage.dispose();
    world.dispose();
  }

  @Override
  public void render() {
    Gdx.gl.glClearColor(1, 0, 0, 1);
    Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);

    world.step(1 / 60f, 6, 2);
    stage.act(Gdx.graphics.getDeltaTime());
    stage.draw();
  }
}

@@ -207,23 +207,119 @@
 dx.math.
-Vector2
+Matrix4;%0Aimport com.badlogic.gdx.math.Vector2;%0Aimport com.badlogic.gdx.physics.box2d.Box2DDebugRenderer
 ;%0Aimport
@@ -403,16 +403,53 @@
 .Stage;%0A
+import com.badlogic.gdx.utils.Array;%0A
 import c
@@ -496,16 +496,44 @@
 wport;%0A%0A
+import java.util.Iterator;%0A%0A
 public c
@@ -676,91 +676,303 @@
 ld;%0A
-%0A  @Override%0A  public void create() %7B%0A    world = new World(new Vector2(0, 0), true
+  private Box2DDebugRenderer debugRenderer;%0A  private Array%3CProjectile%3E bulletToBeRemoved;%0A%0A  @Override%0A  public void create() %7B%0A    world = new World(new Vector2(0, 0), true);%0A    bulletToBeRemoved = new Array%3CProjectile%3E();%0A    world.setContactListener(new CollisionListener(bulletToBeRemoved)
 );%0A%0A
@@ -1299,12 +1299,21 @@
 new 
-Move
+PlayerControl
 List
@@ -1540,24 +1540,77 @@
 enWidth)));%0A
+    stage.addListener(new ShootingListener(player));%0A
     stage.ad
@@ -1934,24 +1934,49 @@
 FFER_BIT);%0A%0A
+    removeUsedBullets();%0A
     world.st
@@ -1979,16 +1979,17 @@
 d.step(1
+f
  / 60f, 

Add projectile functionality to Player