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 / 2d Ball direction

Author
Message
Justice
20
Years of Service
User Offline
Joined: 22nd Jun 2004
Location:
Posted: 26th Mar 2015 12:03
Hi,

I have a simple program which bounces a ball when it hits my bat.

When it hits the right side of the bat it goes to the right (great), but when it hits the left side it should go to the left but it still goes to the right.

I think im missing something really simple, but its driving me crazy !!

Any ideas :0

Attachments

Login to view attachments
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 26th Mar 2015 15:32 Edited at: 26th Mar 2015 15:36
In the function bounce_off_paddle(), the variable middle should be the distance from the left and right you want the center of the paddle defined.

Login to post a reply

Server time is: 2024-11-27 05:35:29
Your offset time is: 2024-11-27 05:35:29