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 / Breakout...Bat/Ball Angle and Atanfull

Author
Message
Pincho Paxton
22
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 26th Jan 2005 17:50
I'm a bit confused about getting a Bat/ball angle which can differ depending on where the ball hits the bat.

It's something like....

ball xpos - bat xpos
ball ypos - bat ypos

AtanFull(difference in X positions, difference in Y positions)

Wrapvalue goes in there somewhere as well.

Can someone post the exact code please.

Thanks!

Pincho.

NathanF
21
Years of Service
User Offline
Joined: 24th Mar 2004
Location:
Posted: 26th Jan 2005 18:04
this should work:



moves the ball away from itself (relative) facing away from the bat, and moving at a 'move' speed. This should gradually move the ball away from the bat.


"Blame yourself, or God." - Delita
Pincho Paxton
22
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 26th Jan 2005 19:16 Edited at: 26th Jan 2005 19:30
Thanks! Mine is 2D. I'm still working on it.

I use this ball movement, which is not compatible with angles. So now I am looking for another way to move the ball around.


IF ballx_dir = 0 then DEC ball_x, ball_speed

IF ballx_dir = 1 then INC ball_x, ball_speed

IF bally_dir = 0 then DEC ball_y, ball_speed

IF bally_dir = 1 then INC ball_y, ball_speed

Login to post a reply

Server time is: 2025-05-24 04:02:11
Your offset time is: 2025-05-24 04:02:11