Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Block-Based Collision Detection?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 YodaTheCoder   Members   -  Reputation: 122

Like
Likes
Like

Posted 16 December 2001 - 11:36 AM

Here''s my setup: I have a 3D, first person enviroment. I have walls (blocks really) that are, well, the walls. I have a function that reads an array that looks like this: int grassArray[4][]={ {0,0,0,1,0,1,0,0}, {0,0,1,0,0,1,0,0}, {0,1,0,0,0,1,0,0}, {1,0,0,0,0,1,0,0}, }; And everytime is sees a ''1'' it will place a 3d block (which is my wall). IS there a way I can not run through my walls? I have tried everything from checking to see whether the player coords are at a given position, but that''s HELL to keep track of! There must me an easier way.. Thanks for your time, Yoda "May the force be with you... $2.25 please."

Sponsor:

#2 a person   Members   -  Reputation: 118

Like
Likes
Like

Posted 16 December 2001 - 05:10 PM

yeah, checking whether the player''s bound box is going through your blocks. look up collision detection on this site as well as google.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS