@Override
	public void update(GameContainer gc, int delta) throws SlickException
	{
		Input ip = gc.getInput();
		mouseX = ip.getMouseX();
		mouseY = ip.getMouseY();

		cam.update(objects.GetPlayerPos());

		objects.update(bt * delta / 1000f, mouseX, mouseY, ip, cam.getPos());

		// Press tab to restart
		if (ip.isKeyPressed(Input.KEY_TAB))
		{
			// bt = 1.0f;
			init(gc);
		}
		if (ip.isKeyPressed(Input.KEY_F1))
		{
			switch (state)
			{
			case inGame:
				state = GameState.inEditor;
				objects.setInEditor(true);
				break;
			case inEditor:
				state = GameState.inGame;
				objects.setInEditor(false);
				break;
			default:
				state = GameState.inEditor;
				objects.setInEditor(false);
				break;
			}
		}

		// Press ESC to quit
		if (ip.isKeyPressed(Input.KEY_ESCAPE))
		{
			System.exit(0);
		}

		// Flushes old unused datas
		ip.clearKeyPressedRecord();
		ip.clearMousePressedRecord();
	}