public void update() {
		KeyboardAdapter kba = KeyboardAdapter.getInstance();
		int dx = 0;
		int dy = 0;
		if (kba.isPressed(KeyboardAdapter.KEY_NAME.UP)) {
			dy -= speed;
		}
		if (kba.isPressed(KeyboardAdapter.KEY_NAME.DOWN)) {
			dy += speed;
		}
		if (kba.isPressed(KeyboardAdapter.KEY_NAME.LEFT)) {
			dx -= speed;
		}
		if (kba.isPressed(KeyboardAdapter.KEY_NAME.RIGHT)) {
			dx += speed;
		}
		
		if (kba.isPressed(KeyboardAdapter.KEY_NAME.CONFIRM) && 
				player.hasMule() && location == 2) { 
			int r = y/1000; 
			int c = x/1000;
			Tile tile = map.getTileAt(r, c);
			//if the player tries to place the MULE on an empty tile they own, it succeeds
			if (tile.getOwner() == player && !tile.hasMule()) {
				tile.setMule(player.getMule());
				player.removeMule();
			}
			else {
				player.removeMule();
			}
		}
		
		x += dx;
		y += dy;
		
		correctSpritePosition();
		location = calculateLocation();
	}