lucafacchini0 / FacchiniRPG

1 stars 0 forks source link

problem with player sprite update animation when player moved diagonally down #3

Closed swisscoder1489 closed 4 hours ago

swisscoder1489 commented 4 hours ago

if the player is idling after having moved diagonally down the animation of the eyes is too fast

lucafacchini0 commented 4 hours ago

Thanks, the problem is solved.

I modified the setMultiplier method in Player class in this:

    private void setMultiplier(String direction, int spriteImageNum) {
        if (direction.contains("idling")) {
            if (spriteImageNum == 1) {
                spriteCounterMultiplier = IDLING_PLAYER_SPRITE_MULTIPLIER_EYES_OPEN;
            } else {
                spriteCounterMultiplier = IDLING_PLAYER_SPRITE_MULTIPLIER_EYES_CLOSED;
            }
        } else {
            spriteCounterMultiplier = MOVING_PLAYER_SPRITE_MULTIPLIER;
        }
    }