package space;

import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.Point;
import java.awt.Toolkit;
import java.awt.event.KeyEvent;

import javax.media.opengl.GL;

import eng.Data;

import util.ImageLoader;
import world.GameScene;

@SuppressWarnings("serial")
public class Game extends GameScene {
	
	public Game() {
		
	}
	
	public void initiate(Data data) {
		
		super.initiate(data);
		
		audio = "None";
	}
	
	public void initializeWorld(GL gl) {
		world = new World(gl);
	}
	
	public void update() {
		
		super.update();
		
		for(int i = 0; i < input.getKeysDown().size(); i++)
			
			if(input.getKeysDown().get(i) == KeyEvent.VK_ESCAPE)
				ended = true;
	}
	
	public Cursor getCursor() {
		
		Toolkit toolkit = Toolkit.getDefaultToolkit();
		Dimension size = toolkit.getBestCursorSize(WIDTH, HEIGHT);
		Point cursorHotSpot = new Point(size.width / 2, size.height / 2);
		Cursor customCursor = toolkit.createCustomCursor(ImageLoader.getImage("/visual/misc/Cursor.png"),
				cursorHotSpot, "Cursor");
		
		return customCursor;
	}
}