Hi Jim,

The reason I do that is because I store everything like doors, walls,
fire traps, chasms, etc in a 3d array. Basically, how it works is I
take the current directionand coordinates and calculate a vector along
that direction x units away to find out where the player will be next.
I then check the array to see what is there and take whatever action
is necessary.

There is nothing specifically wrong with the way you do colision
detection, but I can think of some limitations. For example, in some
games a player might have to use explosives to blow a hole in a wall,
floor, etc to gain access to some secret area. If your colision
detection is hard coded like that it isn't going to be easy to remove
a section of the wall and leave part or most of it standing. With an
array all you need to do is calculate the blast radius of the
explosion and remove however many elements necessary to make that size
hole in the wall. Make sense?



On 12/30/10, Jim Kitchen <j...@kitchensinc.net> wrote:
> Hi Thomas,
>
> I am wondering why you need to know a step ahead.  Why not just detect an
> actual collision?  I have always found that to be good enough.  You know
> detect the collision and do what would happen for a collision like before
> doing what would happen if there was not a collision.  I E do not up date
> the graphics or in our case the sounds etc.
>
> I also have always found that square, rectangle or cube is good enough and
> thus do not do the circular or spherical detection that then requires trig
> or whatever.  Maybe if we were doing graphics one would be able to tell, but
> I do not believe that one would know the difference in our games.
>
> I just do collision detection like
>
> if hx > 32 and hx < 37 then
> if hy > 44 and hy < 47 then
> Bang! Homer ran into something.
> end if
> end if
>
> And of course for a three D just add the third check
>
> if hx > 32 and hx < 37 then
> if hy > 44 and hy < 47 then
> if hz > 22 and hz < 25 then
> Bang! Homer ran into something.
> end if
> end if
> end if
>
> I guess that I just like to keep things simple because that is the only way
> that I know how to do it with my limited math knowledge etc.
>
> BFN
>

---
Gamers mailing list __ Gamers@audyssey.org
If you want to leave the list, send E-mail to gamers-unsubscr...@audyssey.org.
You can make changes or update your subscription via the web, at
http://audyssey.org/mailman/listinfo/gamers_audyssey.org.
All messages are archived and can be searched and read at
http://www.mail-archive.com/gamers@audyssey.org.
If you have any questions or concerns regarding the management of the list,
please send E-mail to gamers-ow...@audyssey.org.

Reply via email to