How can I change the direction of movement?

You absolutely can do that, @malek! For a game like that most of the work would go into building the aesthetic, but that is usually the final part of the development cycle. But yes, not only do I recommend using Unreal Engine 5 for that as a moderator here, I also recommend it as a developer myself because UE5 is built with games like this in mind!