Lesson 10: Walls

Started by
0 comments, last by yoelshoshan 12 years, 4 months ago
I am looking a code at lesson 10. When we move in our world, we can walk through walls. I would like to change code, so I can't walk through walls and here I have a problem, because I don't know how to do it. I know how to solve this problem if I have coordinates in code, but here I don't have idea, so I would like to ask you for some help.
Advertisement
The usual term for this is "Collision Detection & Response"
Google might provide few nice tutorials, perhaps add the keyword "basic" to your search as well, since this is a rather advanced topic.
If you're new to 3D graphics, It's often best to first learn and/or implement in 2D.

In this specific case, when the user attempts to move, there is a "requested movement vector".
In the "collision detection" step, you check how much of the requested movement vector it's ok to move without hitting any obstacle.
If the allowed move is only partial, a "collision response" should be calculated and added to the allowed move.
For example, to create slide on walls to have a more dynamic gameplay flow (think about doom :) )

This topic is closed to new replies.

Advertisement