Jump to content
  • Advertisement
Sign in to follow this  
skifun

Lesson 10: Walls

This topic is 2528 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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 :) )

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!