@Override
	public void tick(Input input, double delta) {
		super.tick(input, delta);

		if (input.buttons[Input.ESCAPE]) {
			setScreen(new TitleScreen());
			input.releaseAllKeys();
		}
		if (input.buttons[Input.PAUSE] && !input.oldButtons[Input.PAUSE]) {
			togglePause();
		}
		if (!paused) {
			for (int i = 0; i < gameObjects.size(); i++) {
				gameObjects.get(i).tick(input, delta);
			}
		} else {
			pauseLayer.tick(input, delta);
		}
		if (life == 0) {
			time += delta / Game.factor;
			if (!fadeOutLayer.isFadingOut()) {
				fadeOutLayer.startFadeOut();
			}
			if (time >= 40D) {
				setScreen(new TitleScreen());
				input.releaseAllKeys();
			}
		}

	}