WindowsApi
written in C
I have not cleaned up the code yet!
Up : space
Down : shift
Move : w,a,s,d
Rotation : ↑,↓,←,→
Horizontal_rotation * Vertical_rotation
Let "Horizontal rotation" be "H"and "Distance traveled" be "D"
The player's "Horizontal rotation" value is stored in degree,
So, when calculating, it should be calculated as radian value.
Therefore, H = (Horizontal rotation) * (PI / 180).
player_x += cos(H + (π / 2)) * (-D)
player_z += sin(H + (π / 2)) * D
player_x += cos(H - (π / 2)) * (-D)
player_z += sin(H - (π / 2)) * D
player_x += cos(H + π) * D
player_z += sin(H + π) * (-D)
player_x += cos(H) * D
player_z += sin(H) * (-D)