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 / Okay and now then?

Author
Message
Slooper
21
Years of Service
User Offline
Joined: 13th Feb 2003
Location: Sweden
Posted: 18th Feb 2003 20:32
Okay rhis is the code






And how do I make this ball to move and then how should I make the playground for the ball to move in
You never fails, only make mistakes.
Slooper
21
Years of Service
User Offline
Joined: 13th Feb 2003
Location: Sweden
Posted: 19th Feb 2003 10:50
it is for pro and it works for me anyway but now i want the ball to bounce on the screen how will I do that?

You never fails, only make mistakes.
BackBONE
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location:
Posted: 19th Feb 2003 21:37
Maybe SIN() and COS() helps out.

As U Probably know sin and cos create a circle when u use it for x and y coordinates.

To make it clear:

Make Object Sphere 1,30

sync on

do
r#=wrapvalue(r#+1)
position object 1,sin(r#)*30,cos(r#)*30,0
sync
loop

this will make the ball move around the coords 0,0,0 in a circle with a diameter of 30.

if u want him to bounce just reset r# on 180 degres.
play around with it. Maybe use curvevalue and curveangle
to make it more realistic.Or youse difrent multiplicators for x and y to make more elyptic jumps.

Now its up to U.Experiment a bit around!
Flashing Blade
21
Years of Service
User Offline
Joined: 19th Oct 2002
Location: United Kingdom
Posted: 20th Feb 2003 02:00
do you wanta pong/breakout effect?

If so just reverse the relevent velocity when ball hits boundry. ie reverse x velocity when ball hits left wall or right wall and reverse y velocity when ball hits top wall or bat. Thats the basic physics you need to add a bit for effects of ball hitting a moving bat but that shouldn't be 2 hard.
Anyway I diddled with your code a bit:



hope this helps
Flashing Blade
21
Years of Service
User Offline
Joined: 19th Oct 2002
Location: United Kingdom
Posted: 20th Feb 2003 02:02
oh press SPACE to fire ball
Slooper
21
Years of Service
User Offline
Joined: 13th Feb 2003
Location: Sweden
Posted: 20th Feb 2003 22:31
okay I´m testing it thanx

You never fails, only make mistakes.

Login to post a reply

Server time is: 2024-09-19 17:41:20
Your offset time is: 2024-09-19 17:41:20