|
||
|
GP Mailing List
ATXGPSIG List
|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Game Programming: 2d map collision detection
------------------------------------------------------------ GameProgrammer.Com: Game Programming: 2d map collision detection ------------------------------------------------------------ By Allen Seitz (Bigal) on Friday, September 22, 2000 - 05:42 pm: So when 2 objects collide you need the second to move away from the first in the opposite direction and same speed? After you've figured out the velocity of the second object ( Physics lession omitted ) you should probably also figure out the new velocity of the first object ( accounting for a less of inertia ). Now replace the 2 old velocities with the 2 new ones. I'm assuming you have some function that's called which updates each objects position based on their velocity and maybe another ( or the same one ) to update the velocity ( collision? loss of speed? etc? ). If you have that then the objects should move on their own. Any size of map grid is fine but the detail you put into it is really what affects the speed the game runs at. If you have a position table along with a velocity table then make sure that the space is available BEFORE a change in position is made by that updatepos(VelTable) function. ------------------------------------------------------------ DO NOT REPLY TO THIS MESSAGE! It is an automatic e-mail notification message from the discussion board indicating that a new message was posted. If you do not wish to receive further e-mail notification messages from this discussion board, edit your user or moderator profile to turn off the e-mail notification option. Use this link to go directly to the discussion: http://gameprogrammer.com/cgi-bin/comm/gameprogrammer/discus/show.pl?6/88
|
|