@Override
	public void run() {
		while(true){
			
			long startTime = System.currentTimeMillis();

			// Check for event triggers
			events.update();

			// Updates the player
			player.update();

			// Checks collision
			collision.update();

			// Check for mapswitch
			mapChange.update();

			// Updates enemies
			Iterator<Character> it = characters.iterator();
			while(it.hasNext()){
				Character c = it.next();

				// Checks if character is still alive
				if( c.isDead() ){
					player.updateQuests(c.getName(), player);
					player.updateStatistics("Monster");

					it.remove();
				}
				c.update();
			}

			if(player.getHealth() <= 0)
			{
				alive = false;
			}

			try 
			{
				long timespent = System.currentTimeMillis() - startTime;
				if(timespent < 1000/fps)
				{
					Thread.sleep((1000/fps) - timespent); //Sleeps to adjust game to fps
				}
			} catch (InterruptedException e) {e.printStackTrace();}
		}
	}