public Main() {
		Dimension d = new Dimension(WIDTH, HEIGHT);
		this.setSize(d);
		this.setPreferredSize(d);
		this.setMinimumSize(d);
		this.setMaximumSize(d);
		
		this.setFocusable(true);
		this.setIgnoreRepaint(true);
		
		game = new Asteroids();
		this.addKeyListener(game);
		//this.addMouseListener(game);
		//this.addMouseMotionListener(game);
		setFocusable(true);

		logicThread = new Thread() {
			public void run() {
				long prevTime = System.currentTimeMillis(), currTime;
				int tick;
				while(running){
					try{
						Thread.sleep(20);
					}catch(InterruptedException e){
						e.printStackTrace();
					}
					currTime = System.currentTimeMillis();
					tick = (int)(currTime - prevTime);
					prevTime = currTime;
					
					game.update(tick);
					
					if(tick > 25 && fps > 1)
						fps--;
					else if(fps<60)
						fps++;
				}
			}
		};
		
		renderThread = new Thread(){
			public void run(){
				while(running){
					try{
						Thread.sleep(1000/fps);
					}catch(InterruptedException e){
						e.printStackTrace();
					}
					render();
				}
			}
		};
	}