public void Update(GameTime gameTime)
	{
		// go back to main menu if escape is pressed
		if (mInput.IsKeyHit(Keyboard.KEY_ESCAPE))
		{
			UnLoad();
		}
		
		HandleNetworkMessages();
		
		// calculate the mouse position in game coordinates
		mMousePosition = new Vector2(mInput.GetMouseX(), GameProperties.WindowHeight() - mInput.GetMouseY()).DividedBy(GameProperties.Scale()).Minus(mCameraOffset);
		
		for (int i = 0; i < mPlayers.size(); i++)
		{
			Player player = mPlayers.get(i);
			player.SetMousePosition(mMousePosition);
			player.Update(gameTime);
		}
		
		// move enemies towards player
		for (int i = 0; i < mEnemyList.size(); i++)
		{
			float minDistance = 99999;
			Player closestPlayer = null;
			
			for (int j = 0; j < mPlayers.size(); j++)
			{
				Player player = mPlayers.get(j);
				
				Vector2 difference = mEnemyList.get(i).GetPosition().Minus(player.GetPosition());
				
				float distance = (float)Math.sqrt(
						Math.pow(difference.X, 2)
						+ Math.pow(difference.Y, 2));
				
				if (distance < minDistance)
				{
					closestPlayer = player;
					minDistance = distance;
				}
			}
			
			if (closestPlayer != null)
			{
				((Enemy)mEnemyList.get(i)).MoveTowards(closestPlayer.GetPosition());
			}
		}
		
		GameEntity.UpdateList(gameTime, mEnemyList);
		GameEntity.UpdateList(gameTime, mBulletList);
		
		HandleBulletCollisionWithEnemies();
		HandleBulletCollisionWithWalls();
		
		for (int i = 0; i < mPlayers.size(); i++)
		{
			Player player = mPlayers.get(i);
			HandlePlayerCollisionWithEnemies(player);
		}
		
		HandleEnemyCollisionWithEnemies();
		
		mSparkList.clear();
		mLastingGridPushes.clear();

		SpawnEnemies();
		
		SendNetworkMessages();
		
		//MoveCamera(10);
	}