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.

Newcomers DBPro Corner / 3D collision

Author
Message
Daz
21
Years of Service
User Offline
Joined: 26th Dec 2002
Location: United Kingdom
Posted: 11th Feb 2003 20:33
2 things I want from collision :


1 : How do I tell my program to stop the object from moving when it hits a wall, so far I got this =

IF OBJECT HIT(1, 2) THEN ...

2 : How do I tell my program to move the object in the opposite direction when it hits a wall, same code as above.

Cheers,

Daz
DarkBASIC Professional is the best programming utility.
8/10 Housewives agree!
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 11th Feb 2003 20:54
well, you just dont move the object when it hits a wall. simple. this would work instead of using 'move object':

IF OBJECT HIT(1, 2)=0 THEN MOVE OBJECT 1,1

then when the 2 objects touch the first one wont move anymore. Honestly, you should ask me for help if you need it!

xxxpetratxxx
B. R. W
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 11th Feb 2003 20:55
oops, this is the correct code:

IF OBJECT COLLISION(1, 2)=0 THEN MOVE OBJECT 1,1
but I think both should work depending on what you want. the 'COLLISION' is the best one

xxxpetratxxx
B. R. W
Daz
21
Years of Service
User Offline
Joined: 26th Dec 2002
Location: United Kingdom
Posted: 11th Feb 2003 21:08
Okay, I'll remember to contact you telepathically when I need help.

DarkBASIC Professional is the best programming utility.
8/10 Housewives agree!
Daz
21
Years of Service
User Offline
Joined: 26th Dec 2002
Location: United Kingdom
Posted: 11th Feb 2003 21:12
Here's somet 4 u :

IF OBJECT COLLISION(4, 1) = 0
MOVE OBJECT UP 4, 0.5
MOVE OBJECT DOWN 4, 0.5
MOVE OBJECT LEFT 4, 0.5
MOVE OBJECT RIGHT 4, 0.5
ENDIF

My object moves 4 ways. Oh, oh, please help me, xxxpetratxxx.

DarkBASIC Professional is the best programming utility.
8/10 Housewives agree!
Daz
21
Years of Service
User Offline
Joined: 26th Dec 2002
Location: United Kingdom
Posted: 11th Feb 2003 21:13
What about my second question?

DarkBASIC Professional is the best programming utility.
8/10 Housewives agree!
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 11th Feb 2003 23:39
'IF OBJECT COLLISION(4, 1) = 0
MOVE OBJECT UP 4, 0.5
MOVE OBJECT DOWN 4, 0.5
MOVE OBJECT LEFT 4, 0.5
MOVE OBJECT RIGHT 4, 0.5
ENDIF'

Thats funny coz those commands dont exist...

xxxpetratxxx
B. R. W
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 11th Feb 2003 23:42
or maybe DBPro has those commands...

Try this to turn when u hit a wall:




That should work now!

xxxpetratxxx
B. R. W
Daz
21
Years of Service
User Offline
Joined: 26th Dec 2002
Location: United Kingdom
Posted: 12th Feb 2003 18:57
Okay, there should be easier commands than using coordinates, as I've just look through some of the new tutorials. When I say opposite direction I mean like a rubber ball bouncing off walls. How do I get that effect? Like a "mirror" effect. Where it bounces at the same angle. Say it bounced at an angle of 45 degrees. It would bounce 45 degrees the other way. Get me?

DarkBASIC Professional is the best programming utility.
8/10 Housewives agree!
Daz
21
Years of Service
User Offline
Joined: 26th Dec 2002
Location: United Kingdom
Posted: 12th Feb 2003 19:03
I need this for my game for the compo. I need to do a background, collison for paddles and a ball bouncing how I want it to. Then I'm done and I can add little features like trails and a ball that appears to be bouncing.

All before April 7th, eek!

DarkBASIC Professional is the best programming utility.
8/10 Housewives agree!
Daz
21
Years of Service
User Offline
Joined: 26th Dec 2002
Location: United Kingdom
Posted: 13th Feb 2003 18:48
Little help?

DarkBASIC Professional is the best programming utility.
8/10 Housewives agree!

Login to post a reply

Server time is: 2024-11-24 02:40:11
Your offset time is: 2024-11-24 02:40:11