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 / Bouncing Off Cubes

Author
Message
Flaming Ghost
20
Years of Service
User Offline
Joined: 29th Apr 2005
Location: Um...Right here
Posted: 8th Jun 2005 04:34 Edited at: 10th Jun 2005 00:57
I'm trying to make a sort of 3-D Breakout game, I want to make it so that you must try to bounce the ball up and hit the red cube(s). When you hit the cube, I want the ball to bounce away, and the red block to go away. How can I make it so that when a ball hits the bottom of the cube, it'll bounce away down, and if it hits the sides, it'll bounce away sideways? Here's my code so far:


I will take any help!

Am I dead yet?
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 10th Jun 2005 03:50
what about this?

if the ball is on the left side or right side of the cube then
h_speed# = h_speed# * -1

if the ball is on the upper side or bottom side of the cube then
v_speed# = v_speed# * -1

Immunity and Annihalation makes Immunihalation...
Jake Blues
20
Years of Service
User Offline
Joined: 19th Jun 2004
Location: United States
Posted: 10th Jun 2005 07:15


Baggers
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Yonder over dem dere hills
Posted: 27th Jun 2005 21:55
If you have the expansion pack i'd recommend sparky's dll for the 'intersect object' command...id also use vectors. To get them for DB see here.
http://forum.thegamecreators.com/?m=forum_view&t=50609&b=10

That may be a bit much to learn for one project though !
Hope it helps.

Login to post a reply

Server time is: 2025-05-22 20:00:49
Your offset time is: 2025-05-22 20:00:49