@Override
	public void init() {
		frontBuffer = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_ARGB);
		backBuffer = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_ARGB);
		frontBufferG = frontBuffer.getGraphics();
		backBufferG = backBuffer.getGraphics();
		
		keys = new boolean[256];
		addKeyListener(this);
		addMouseListener(this);
		
		locale = new Localization("EN");
		highscoresMenu = new Highscores(this);
		
		Thread t = new Thread(){
			@Override
			public void run() {
				while(true){
					lastRenderTime = System.nanoTime();
					render();
					repaint();
					frames++;
					if(System.currentTimeMillis()/1000 != lastSecond){
						fps=(int)(frames*(System.currentTimeMillis()/1000D-lastSecond));
						lastSecond=System.currentTimeMillis()/1000;
						frames=0;
					}
					while(System.nanoTime() - lastRenderTime < 15660 * 1000){
						try {Thread.sleep(1);} catch (InterruptedException e) {e.printStackTrace();}
					}
				}
			}
		};
		Thread logic = new Thread(){
			@Override
			public void run() {
				while(true){
					if(System.nanoTime()-lastLogicTime > TICK_MS * 1000 * 1000 * 5){lastLogicTime = System.nanoTime();}
					else{lastLogicTime+=TICK_MS*1000*1000;}
					logic();
					while(System.nanoTime() - lastLogicTime < TICK_MS * 1000 * 1000){
						try {Thread.sleep(1);} catch (InterruptedException e) {e.printStackTrace();}
					}
				}
			}
		};
		startGame();
		t.start();
		logic.start();
		pauseGame();
	}