- fix todo (optimize calculating movement direction of a player)