To achieve such a function:
Each press movement key, the next role moving a unit of distance, a movement to button again after the next move, namely how to realize the role step by step to walk, not very free move this dish thank you bosses!
CodePudding user response:
Basic logic: the player character keys - play character animation - mobile coordinate/vector (a fixed direction distance)Judge branches: character button, the current in the walking state (using function to judge character animation state or the state machine) - cancel moving again,