protected Image animate(Direction dir) {
		AnimationState prevAnimationState = animationState;
		
		if (dir == Direction.LEFT || dir == Direction.UP_LEFT || dir == Direction.DOWN_LEFT) {
			animationState = AnimationState.MOVING_LEFT;
		}
		else if (dir == Direction.RIGHT || dir == Direction.UP_RIGHT || dir == Direction.DOWN_RIGHT) {
			animationState = AnimationState.MOVING_RIGHT;
		}
		else {
			animationState = AnimationState.STANDING;
		}
		
		if (prevAnimationState != animationState) {
			animations.get(animationState).reset();
		}
		Image animationImage = animations.get(animationState).animate();
		
		if (invulnerable) {
			if (invulnerableTimer % 2 == 0) {
				animationImage = Animation.getBlankImage(PLAYER_WIDTH, PLAYER_HEIGHT);
			}
		}
		
		return animationImage;
	}