Smooth movement (design question)
Posted: Tue Sep 02, 2014 10:25 pm
Heya,
recently I started implementing smooth movement between tiles in my game. I came up with a method that uses lerping to smoothly correct the player's position on one axis, while he is moving on the other. It works pretty well, but I have a pretty stupid question which is more a related to design rather than code (at least that's what I think).
The problem occurs at crossroads with two valid paths like this (red is the actual tile position, blue is the real position): When the player presses two keys at the same time (in this case up and right) then the character gets stuck in between tiles like in the image above. I already tried a few things like discarding one of the input directions, but haven't found a solution that I like.
Any ideas?
recently I started implementing smooth movement between tiles in my game. I came up with a method that uses lerping to smoothly correct the player's position on one axis, while he is moving on the other. It works pretty well, but I have a pretty stupid question which is more a related to design rather than code (at least that's what I think).
The problem occurs at crossroads with two valid paths like this (red is the actual tile position, blue is the real position): When the player presses two keys at the same time (in this case up and right) then the character gets stuck in between tiles like in the image above. I already tried a few things like discarding one of the input directions, but haven't found a solution that I like.
Any ideas?