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 / bouncy ball help needed

Author
Message
Justice
20
Years of Service
User Offline
Joined: 22nd Jun 2004
Location:
Posted: 13th Mar 2015 19:59
Hi,

I have a little program which bounces a ball around the screen.

I have a paddle at the bottom of the screen which bounces the ball back.

When the ball hits the right side of my paddle it bounces to the right side of the screen. which is what I want

But, when the ball hits the left side of my paddle the ball still bounces to the right side of the screen, I would like it to go to the left.

Any help would be appreciated.

Attachments

Login to view attachments
Sasuke
18
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 13th Mar 2015 20:43
The problem in your code is here:


Specifically: if ax<right-12 where it needs to be more than instead of less than.

"Get in the Van!" - Van B
Justice
20
Years of Service
User Offline
Joined: 22nd Jun 2004
Location:
Posted: 13th Mar 2015 21:44
Thank you, that silly mistake was driving me insane !!!
Sasuke
18
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 14th Mar 2015 02:28
When that happens to me I know it's a nightmare. Going through line by line to see if you can find the problem but you can't cause it all looks like it should work. I feel your pain

"Get in the Van!" - Van B

Login to post a reply

Server time is: 2024-11-27 05:38:08
Your offset time is: 2024-11-27 05:38:08