@Override
	public void run() {
		s = new StartLogo(this);

		p = new PlayField(input);
		p.reset();
		long lastTick = System.nanoTime();
		double nsPerTick = 1000000000D / 40D;

		long lastFrame = System.nanoTime();
		double nsPerFrame = 1000000000D / 60D;

		int ticksPS = 0;
		int framesPS = 0;

		long lastTimer = System.currentTimeMillis();
		double deltaTick = 0;
		double deltaFrame = 0;

		while (running) {
			long now = System.nanoTime();
			deltaTick += (now - lastTick) / nsPerTick;
			lastTick = now;

			deltaFrame += (now - lastFrame) / nsPerFrame;
			lastFrame = now;

			while (deltaTick >= 1) {
				ticksPS++;
				s.tick();
				deltaTick -= 1;
				render();
			}

			while (deltaFrame >= 1) {
				framesPS++;
				deltaFrame -= 1;
				render();
			}

			if (System.currentTimeMillis() - lastTimer >= 1000) {
				lastTimer += 1000;
				System.out.println("Ent: " + p.getEntityAmmount());
				System.out.println("FPS: " + framesPS);
				System.out.println("TPS: " + ticksPS);
				System.out.println("-------");
				framesPS = 0;
				ticksPS = 0;
			}

			try {
				Thread.sleep(10L);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}