Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Strange collision problem.

Author
Message
Axelman
21
Years of Service
User Offline
Joined: 18th Oct 2003
Location: Parallel Universe
Posted: 17th Jul 2004 16:00 Edited at: 17th Jul 2004 16:11
I have a very Strange Collision Problem,It goes like this.



Object 1 is the player, a sphere (at the moment) and objects 3,4,5 and 6 are the walls. for some reason the variable "Lives" only decreces when object 1 collides with object 3, the right wall. it goes straight through all the other walls. I have also tried using the OBJECT COLLISION() Command but that didn't work.

Please don't Flame me about not searching, because i did search and read most of the things that came up.

I hope you guys can help,
Thanks in advance,
Axelman.

*EDIT*
By the way, this peice of code goes in the main loop.
*EDIT*

CURRENT PROJECT: Enemy At The Gates
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 17th Jul 2004 18:52 Edited at: 17th Jul 2004 18:53
Try this;



Hope that works for ya

Jess.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Axelman
21
Years of Service
User Offline
Joined: 18th Oct 2003
Location: Parallel Universe
Posted: 17th Jul 2004 21:37
Geez, didn't think of that, Know i whish i had, Shoulda used a variable.

Thanks again Jess, You saved me as usual.

Anyways,
Cya Later,
Axelman.

CURRENT PROJECT: Enemy At The Gates
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 17th Jul 2004 21:46
Anytime Axel

Jess.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Axelman
21
Years of Service
User Offline
Joined: 18th Oct 2003
Location: Parallel Universe
Posted: 18th Jul 2004 12:06 Edited at: 18th Jul 2004 12:26
Yea, i just thought of a dif way, you use a FOR NEXT Loop.



you gotta admit, i am getting alot better at db.

*EDIT
But Your one is works and my one doesn't

CURRENT PROJECT: Enemy At The Gates
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 18th Jul 2004 23:50
Axel,
Also, in my code, I only call Object Collision ONCE, whereas in your new code, you call it 3 times, which can be a serious speed hit.

Jess.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Axelman
21
Years of Service
User Offline
Joined: 18th Oct 2003
Location: Parallel Universe
Posted: 19th Jul 2004 11:34
Yup, i sorta figured tat out, cause when you use the OBJECT COLLISON(1,0) command like that it calls collision with all objects, doesn't it?

Anyways,
Thanks again Jess,
Axelman

CURRENT PROJECT: Enemy At The Gates

Login to post a reply

Server time is: 2025-05-26 00:17:16
Your offset time is: 2025-05-26 00:17:16