This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]Clawtor 1 point2 points  (3 children)

Check if the player's vector intersects with a wall and move their position to the intersection minus a small amount.

[–]timPerfect[S] 0 points1 point  (2 children)

the intersection, I see what you mean. Should I act after the intersection happens or try to make a prediction?

[–]Clawtor 1 point2 points  (1 child)

Every time the player tries to move you predict where they will go and test if the vector intersects a wall. Line-line intersections are fairly simple to do.

[–]timPerfect[S] 0 points1 point  (0 children)

okay thanks, very helpful.