@Override
	public void update(){

		//		if(guiDisplaying instanceof GuiHud)
		//			System.out.println(GameTime);

		if(backGrounds != null && !backGrounds.isEmpty())
			for(Background bg : backGrounds)
				bg.update();

		handleInput();

		tileMap.setPosition((GamePanel.WIDTH / 2) - player.getScreenXpos(),(GamePanel.HEIGHT / 2) - player.getScreenYpos());

		if((guiDisplaying instanceof GuiHud)){
//			GameTime++;
//
//			if(GameTime >= 32000){
//				GameTime = 0;
//			}
			//TODO put night time back into the game

			if(isNightTime())
				SpawningLogic.spawnNightCreatures(this);

			player.update();

			for(MapObject obj : listWithMapObjects){
				obj.update();
				if(obj.remove){
					listWithMapObjects.remove(obj);
					break;
				}
			}
		}
	}