With CharacterBody2D as the root
Add a CollisionShape2D node as child
In the Shape property add a new CapsuleShape2D
Add a new AnimatedSprite2D as child
Select the AnimatedSprite2D
In the Sprite Frames property add new SpriteFrames
Click on the SpriteFrames
In the Animation panel press Ctrl+Shift+O or
click on the button to add frames from sprite sheet
Assets --> Player --> Player Front Sheet.png
Set Horizontal frames to 14
You now have a default animation
Click on Project --> Project Settings --> Input Map
Now enable Show Built-in Actions
Find the Actions for ui_up, ui_down etc.
Click on the + next to each
Then press the WASD keys so
We can move the character with them
Add two new input actions
"ui_attack" (attack button)
"ui_sprint" (shift button)
add an export variable to control player speed
Code the physics process function
create a direction variable
find out which direction the player is moving in
if the player is moving diagonally
we normalize the direction
which just means making it 1 so that
the player moves at the same speed
finally apply the movement
and call the move and collide function
Run the project to test the movement
You can move the player in all directions