@Override
	public void run() {
		long pretime, dif, sleep;
		pretime = System.currentTimeMillis();
		
		while(running) {
			this.tick();
			this.repaint();
			//System.out.println(pretime);
			
			dif = System.currentTimeMillis() - pretime;
			sleep = 15 - dif;
			
			if(sleep < 0) {
				sleep = 1;
			}
			
			try {
				Thread.sleep(sleep);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			
			pretime = System.currentTimeMillis();
		}
	}