Ad
  • Custom User Avatar

    That is also what irritated me. It would make more sense if you could move if the direction is already correct.
    The code would have been so much clear without that case...

  • Custom User Avatar

    Fair, but was still unclear to me.

  • Custom User Avatar

    During the first "frame" when a new key is pressed the direction doesn't matter at all, it is just updated as I stated on point 1 (I didn't emphasize that but I never said you should skip the direction update and go straigth to the movement).
    So when I set the starting direction to 8 I just assign an arbitrary default value, which is irrelevant to the rest of the code and could be any other direction, since it is updated on the first frame anyway.

  • Custom User Avatar

    Nice Kata, but one thing in my opinion is not explained well.

    1. When a key is first pressed, the player has to change his direction to that of the current key, without moving

    Ok, understandable, but then you set the direction to 8 in the very beginning, thus implying that first direction is UP, and if UP is the first move, we can move straight away, and do not need to change direction to the one that is already set properly (I thought I don't need to change from 8 to 8, but I was wrong).

    Also, when you press some keys, and a direction is set, let's say, to 8, then we release all the keys (but the direction stays as 8), then we press 8 again, I thought that the player can move straight away, because his direction was already set in the proper direction. It wasn't obvious from the instructions that you need to change direction once again from 8 to 8.

    In my opinion, you should state in the instructions, that in the beginning, and whenever there's a situation that ALL the keys are released, the direction is set to NONE.