Prevent "useless" character movements
Hi everyone !
I've just coded a 2D character movement system, and I'm trying to integrate something I've been meaning to do for a long time, which is a way to make the player always try to go at its maximum speed, no matter the obstacles.
The idea is that in this case, if the player holds up and left, it will still act as if he only presses up, preventing any slowing down from the diagonal movement. Obviously the case happens because I normalize the movement vector before hand, but diagonal movements look ugly otherwise anyway there's no decent game I know of that do this nowadays.
So the idea would obviously to pick up on the collision and rectify the movement, but then if I do that, it will be last frame's collision, which makes me 1 frame late, and since I correct the movement, it will happen only for 1 frame, The end result would be than only 1/2 frames would have the correction. It may be impossible to prevent the 1 frame latency to begin with, but I'd at least like to avoir the 1/2 frames actually corrected.
Does anyone have any ideaas to how to do this ? (even in pseudocode, I can handle myself ;) )
The best example of such a feature I have in mind is World to the West where unless you push the joystick completely toward a wall, the player will otherwise follof the wall at his normal speed.
I also welcome any opinion on whether it would actually be more playable or actually more complicated for the player.
Thanks in advance !
Your answer
Follow this Question
Related Questions
Colliders for tunnels 0 Answers
Collisions not working in top-down RPG? 0 Answers
Line drawn out of a gameobject does not collide with another gameobject 0 Answers
Need Help with Jump Coding 0 Answers
Collision not working 1 Answer