@Override
	public void run() {
		//shadow mode
		Coordinate p;
			p = gui.getPlayerCoordinate(player);
		while (true) {
			// Check if Paused
			synchronized (Game.lockPause) {
				if(Game.isPaused() || Game.isHasWinner())
					try {
						Game.lockPause.wait();
					} catch (InterruptedException e) {
						e.printStackTrace();
					}
			}
			synchronized (p) {
				try {
					p.wait();
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
			}

			if(ghostInterval > 0)
			{
				ghostInterval -= 10;
			}
			if(shockInterval > 0)
			{
				shockInterval -= 10;
			}
			else
			{
				if(ghostInterval > 0)
					setY(gui.getGUIHeight()-gui.getPlayerCoordinate(player).getY());
				else
					setY(gui.getPlayerCoordinate(player).getY());
			}
			try {
				Thread.sleep(10);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}

	}