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 Professional Discussion / collision help :/

Author
Message
SH4773R
16
Years of Service
User Offline
Joined: 18th Jan 2010
Location: AMERICA!!!
Posted: 11th Nov 2010 01:46
i am basing my code on this http://forum.thegamecreators.com/?m=forum_view&t=24813&b=6, i'm loading a map from Google sketch up 6 exported as .x file, how do i use poly collision on the map, default stuff only please, i cant install sparky's collision right :/

code from post above:
Brk_oth
20
Years of Service
User Offline
Joined: 8th Aug 2005
Location: Australia
Posted: 11th Nov 2010 02:33
The default collision command you would be looking to use is SET OBJECT COLLISION TO POLYGONS which sets your loaded object up to use polygon collision. Then in your loop you check for collision and update.
I recommend installing sparky's collision dll as its incredibly good.
What issues are you having with the install of sparkys?

No signature found...
SH4773R
16
Years of Service
User Offline
Joined: 18th Jan 2010
Location: AMERICA!!!
Posted: 11th Nov 2010 04:12
what do i do after i detect collision?, ill try sparkys agian
Brk_oth
20
Years of Service
User Offline
Joined: 8th Aug 2005
Location: Australia
Posted: 11th Nov 2010 06:05 Edited at: 11th Nov 2010 06:06
Once you have detected your collision, you reposition the player.

for example your game loop might look like this:



Now as a side, I was going through some code I have lying around and I found this function. It does sliding collision to an object with the camera (sadly I cant remember the original creator and I didnt put it in a comment at the top of the code )



And here is that code implemented into the code you supplied:


No signature found...
SH4773R
16
Years of Service
User Offline
Joined: 18th Jan 2010
Location: AMERICA!!!
Posted: 11th Nov 2010 06:57
Thanks! Ill test it out tommarro
SH4773R
16
Years of Service
User Offline
Joined: 18th Jan 2010
Location: AMERICA!!!
Posted: 11th Nov 2010 19:00
well it works, sort of, im stuck under the building:


idk did i make the map wrong?
Brk_oth
20
Years of Service
User Offline
Joined: 8th Aug 2005
Location: Australia
Posted: 12th Nov 2010 00:30
well if you start off stuck under the building, try positioning the player is different locations (if your under, try a higher y coordinate)
The line "position camera 0,100,0" just before the game loop is where you position the player for the game.

No signature found...
SH4773R
16
Years of Service
User Offline
Joined: 18th Jan 2010
Location: AMERICA!!!
Posted: 12th Nov 2010 23:20
ok ill try that
SH4773R
16
Years of Service
User Offline
Joined: 18th Jan 2010
Location: AMERICA!!!
Posted: 12th Nov 2010 23:44
its working!, it was my levels fault thanks for your immense help!
now all i need is gravity.....

Login to post a reply

Server time is: 2026-07-21 21:13:03
Your offset time is: 2026-07-21 21:13:03