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 / plz correct this code

Author
Message
James Bond
22
Years of Service
User Offline
Joined: 20th Jul 2004
Location:
Posted: 15th Aug 2004 00:05
whenever i collide my car with the cubes ....... COLLISION IS NOT DETECTED

download the car .x file which i used in this game from http://www.geocities.com/rehansites2/carx.zip
CODE:
Powersoft
22
Years of Service
User Offline
Joined: 1st Aug 2003
Location: United Kingdom
Posted: 15th Aug 2004 03:16
If Object collision(object1,object2)>0

you had obj2 as 0 i think


Create or Play? You choose!
SandraD
22
Years of Service
User Offline
Joined: 30th May 2004
Location: Down on the corner, out in the street.
Posted: 15th Aug 2004 07:02 Edited at: 15th Aug 2004 07:03
Well, the first I would do is order the code correctly... right now your collision detection section beyond the main loop of the movement code entirely! The creation used looks good though, but you can only have one DO..LOOP and get the thing to work. Move the cube creation and detection setup stuff up to the top, and move the detection code itself from the second DO-LOOP into your main movement loop.

Computers are funny; they only do what you tell them to do in the exact order you tell them. By having the detection outside the movement loop, you never have told it to check for it.
S.

[edit Oh yes, and DO NOT make the change suggested by Powersoft. (Sorry Powersoft.)

Any truly great code should be indisguishable from magic.
Powersoft
22
Years of Service
User Offline
Joined: 1st Aug 2003
Location: United Kingdom
Posted: 15th Aug 2004 17:28
i didnt even run the code so i couldnt tell you.....


Create or Play? You choose!

Login to post a reply

Server time is: 2026-07-21 12:38:12
Your offset time is: 2026-07-21 12:38:12