package com.quixotix.agenthon;

import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.Application;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;


public class Agenthon implements ApplicationListener {
    public static final String TAG = "Agenthon";
    private OrthographicCamera camera;
    private ControlProcessor controlProcessor;
    private SpriteBatch batch;
    private Player player;
    
    @Override
    public void create() {        
        // Gdx.app.setLogLevel(Application.LOG_ERROR);
        Gdx.app.setLogLevel(Application.LOG_DEBUG);
        Gdx.app.debug(TAG, "Agenthon.create()");
        
        float w = Gdx.graphics.getWidth();
        float h = Gdx.graphics.getHeight();
        
        camera = new OrthographicCamera(w, h);
        camera.setToOrtho(false);
        
        controlProcessor = new ControlProcessor();
        Gdx.input.setInputProcessor(controlProcessor);
        
        batch = new SpriteBatch();
        
        player = new Player(0, 128);
    }

    @Override
    public void dispose() {
        Gdx.app.debug(TAG, "Agenthon.dispose()");
        batch.dispose();
    }

    @Override
    public void render() {        
        Gdx.gl.glClearColor(0, 0, 0, 1);
        Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
        
        batch.setProjectionMatrix(camera.combined);
        batch.begin();
        player.draw(batch);
        batch.end();
        
        controlProcessor.draw(batch);
        
        if (controlProcessor.upArrow.touched) {
            player.north = true;
        } else {
            player.north = false;
        }
        if (controlProcessor.downArrow.touched) {
            player.south = true;
        } else {
            player.south = false;
        }
        if (controlProcessor.leftArrow.touched) {
            player.west = true;
        } else {
            player.west = false;
        }
        if (controlProcessor.rightArrow.touched) {
            player.east = true;
        } else {
            player.east = false;
        }
        player.update();
    }

    @Override
    public void resize(int width, int height) {
        Gdx.app.debug(TAG, "Agenthon.resize()");
    }

    @Override
    public void pause() {
        Gdx.app.debug(TAG, "Agenthon.pause()");
    }

    @Override
    public void resume() {
        Gdx.app.debug(TAG, "Agenthon.resume()");
    }
}

@@ -51,35 +51,20 @@
 gic.gdx.
-ApplicationListener
+Game
 ;%0D%0Aimpor
@@ -301,38 +301,20 @@
 hon 
-implements ApplicationListener
+extends Game
  %7B%0D%0A

Extend Game class instead of directly implementing ApplicationListener