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 problem...

Author
Message
ronin
22
Years of Service
User Offline
Joined: 18th Feb 2003
Location:
Posted: 20th Feb 2003 04:25
I am trying to detect when a ball hits a character, I know I could use math but the ball is big and I would like to make a reallistic collision detection. With the "object collision" function it works in most of cases but coz the the movement step sometimes it just pass through the target, can you help me please?
Morales
22
Years of Service
User Offline
Joined: 9th Feb 2003
Location: - Please Select -
Posted: 20th Feb 2003 04:49
make the object as long as fast your object will move
so if you make the speed 100 make object box 1,99,1,1
so now it will be a long streat line. i had the same prob
and thats what i use. dont forget to set object collision off whin it comes back or you will have a long stick and everything will get hit.
ronin
22
Years of Service
User Offline
Joined: 18th Feb 2003
Location:
Posted: 20th Feb 2003 05:49
thanx , I have been thinkin about your idea and yes it will work fine, really thx, and about setting the collisions off... I use to delete objects when they finish their duty just to free memory, does it have sense?

Morales
22
Years of Service
User Offline
Joined: 9th Feb 2003
Location: - Please Select -
Posted: 20th Feb 2003 05:59
no what you should do is use one object
try this code

sync on : sync rate 40
make matrix 1,100,100,10,10
color backdrop rgb(0,0,0)
make object box 1,99,1,1
hide object 1
position camera 50,20,50
do
cx#=camera position x()
cy#=camera position y()
cz#=camera position z()
if r=0
hide object 1
position object 1,cx#,cy#-1,cz#
if mouseclick()=1
r=1
endif
endif
if r > 0
move object 1,77
show object 1
if r > 10
r=0
endif
endif
sync
loop
Morales
22
Years of Service
User Offline
Joined: 9th Feb 2003
Location: - Please Select -
Posted: 20th Feb 2003 06:14
do you think you could send me one of the old patches
like 2.0 any one befor 3.0. for some reason i cant get darkbasicpro to work with 3.0 and above.
if you can i will give you my email.
ronin
22
Years of Service
User Offline
Joined: 18th Feb 2003
Location:
Posted: 20th Feb 2003 06:37
thanx for the code , it was really helpful, and sorry but I have the same prob as you, dont know why but this patch doesnt work and I havent any of the older ones
Thats why I am actually using my old DB 1.13, if you want i think i have the patch for this version, of course its not Pro edition but bug after bug i realise that Pro ed is not that good

Login to post a reply

Server time is: 2025-05-18 08:03:35
Your offset time is: 2025-05-18 08:03:35