package com.veil.game;

import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
import com.badlogic.gdx.graphics.g2d.TextureAtlas.AtlasRegion;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.math.RandomXS128;
import com.veil.adl.AgentDatabase;
import com.veil.ai.Controller;

public class TheGame extends Game {
	public ShapeRenderer shapeBatch;
	public SpriteBatch batch;
	public AtlasRegion[] region;
    public BitmapFont font;
    
    public void create() {
    	Controller.instance.setup();
    	if(!AgentDatabase.setup()){
    		System.exit(0);
    	}
    	System.out.println("Data loaded successful!!");
    	
    	MathUtils.random = new RandomXS128(1000);
    	
    	TextureAtlas atlas = new TextureAtlas(Gdx.files.internal("panel.atlas"));
    	region = new AtlasRegion[7];
    	region[1] = atlas.findRegion("frame_a"); //Player
    	region[2] = atlas.findRegion("frame_c"); //Tile 1
    	region[3] = atlas.findRegion("frame_d"); //Tile 2
		region[4] = atlas.findRegion("frame_f"); //Enemy 1
		region[5] = atlas.findRegion("frame_b"); //Enemy 2
		region[6] = atlas.findRegion("frame_e"); //Bullet 1
    	
		shapeBatch = new ShapeRenderer();
        batch = new SpriteBatch();
        //Use LibGDX's default Arial font.
        font = new BitmapFont();
        
        
        this.setScreen(new InfoScene(this,0));
    }

    public void render() {
        super.render(); //important!
    }

    public void dispose() {
    	shapeBatch.dispose();
        batch.dispose();
        font.dispose();
    }
    
    private int sequence = 0;
    
    public void nextScene(){
    	switch(sequence){
    	case 0: case 2: case 4:
    		this.setScreen(new InfoScene(this,sequence));
    		break;
    	case 1: 
    		GameConstant.profilingMode = false;
    		GameConstant.rangeProfiling = false;
    		this.setScreen(new BattleScene(this));
    		break;
    	case 3:
    		GameConstant.profilingMode = true;
    		GameConstant.rangeProfiling = true;
    		this.setScreen(new BattleScene(this));
    		break;
    	case 6:
    		GameConstant.profilingMode = true;
    		GameConstant.rangeProfiling = false;
    		this.setScreen(new BattleScene(this));
    		break;
    	case 7:
    		Gdx.app.exit();
    		return;
    	}
    	sequence++;
    }
}

@@ -1480,32 +1480,34 @@
 Font();%0A        
+/*
 %0A        %0A      
@@ -1503,53 +1503,539 @@
     
-%0A        this.setScreen(new InfoScene(this,0)
+FileHandle fh = new FileHandle(%22C:%5C%5CUsers%5C%5Cangelix%5C%5CDocuments%5C%5CCU DOC%5C%5CProfile-2016-07-29%5C%5Ctiming_all%5C%5CBoss%22);%0A        FileHandle fh2 = new FileHandle(%22C:%5C%5CUsers%5C%5Cangelix%5C%5CDocuments%5C%5CCU DOC%5C%5CProfile-2016-07-29%5C%5Ctiming_all%5C%5CRange%22);%0A        ProfileEvaluator eva = new ProfileEvaluator();%0A        eva.addBattleProfilePath(fh);%0A        eva.addRangeProfilePath(fh2);%0A        eva.begin();%0A        eva.evaluate(null);%0A        eva.end();%0A        */%0A        //this.setScreen(new InfoScene(this,0));%0A        sequence = 0;%0A        nextScene(
 );%0A 
@@ -2035,25 +2035,26 @@
 ne();%0A    %7D%0A
+%09
 %0A
-
     public v
@@ -2223,24 +2223,24 @@
 %0A    %7D%0A    %0A
+
     private 
@@ -2247,28 +2247,24 @@
 int sequence
- = 0
 ;%0A    %0A    p

Change scene switching code