public void run() {
		long lastTime = System.nanoTime();
		long timer = System.currentTimeMillis();
		final double ns = 1000000000.0 / 60.0;
		double delta = 0;
		int frames = 0;
		int updates = 0;
		requestFocus();
		while (running) {
			long now = System.nanoTime();
			delta += (now - lastTime) / ns;
			lastTime = now;
			while (delta >= 1) {
				update();
				updates++;
				delta--;
			}
			render();
			frames++;

			if (System.currentTimeMillis() - timer > 1000) {
				timer += 1000;
				if (paused) {
					frame.setTitle(title + "   |   " + updates + " ups, " + frames + " fps " + " (PAUSED)");
				} else {
					frame.setTitle(title + "   |   " + updates + " ups, " + frames + " fps");
				}
				updates = 0;
				frames = 0;
				// System.out.println("Count: " + enemyCount);
				// System.out.println("Killed: " + enemyKilled);
				// System.out.println("Score: " + score);
				// System.out.println("Health 2: " + health2);
				if (state == State.GAME) {
					counter++;
				}
				upCounter++;
				downCounter++;
				if (rapidFire || rapidFire2) {
					rapidFireTimer++;
					if (rapidFireTimer == 20) {
						rapidFireTimer = 0;
						rapidFire = false;
						rapidFire2 = false;
					}
				}
				if (round) {
					time++;
				}
				if (p.speedRunner || p2.speedRunner2) {
					speedTimer++;
					speed = 4;
					if (speedTimer == 20) {
						speed = 2;
						p.setSpeed(speed);
						p2.setSpeed(speed);
						p.speedRunner = false;
						p2.speedRunner2 = false;
					}
				}
				specialCounter++;
				if (specialCounter == 30) {
					c.addEntity(new SpecialEnemy(-10, random.nextInt(width * scale - 32), this, tex, c));
					enemyCount++;
					specialCounter = 0;
				}
			}
		}
		stop();
	}