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 / Bouncing Ball Command

Author
Message
VGHero11
13
Years of Service
User Offline
Joined: 15th Nov 2011
Location:
Posted: 27th Jan 2012 19:58
Hello

I am working through Jonathan S. Harbour and Joshua R. Smith's Book, "Beginner's Guide to DarkBASIC Game Programming." One of the programs is entitled BouncingBall Program. The problem is that I have the code right but for some reason the balls hit the right and bottom wall and then stop. I'm wondering whether this is because A.) I did something wrong, or B.) Since I used DarkBASIC Pro instead of DarkBASIC that some commands are different. If someone could tell me that would be great. Thanks.


When we all lend our power together, there is nothing we
can't do!
Please Lend me your STRENGTH!
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 28th Jan 2012 04:49 Edited at: 28th Jan 2012 04:50
In function MoveBall, change this SPEEDX(NUM) = SPEEDX * -1 to SPEEDX(NUM) = SPEEDX(NUM) * -1 and change this SPEEDY(NUM) = SPEEDY * -1 to SPEEDY(NUM) = SPEEDY (NUM) * -1.
VGHero11
13
Years of Service
User Offline
Joined: 15th Nov 2011
Location:
Posted: 30th Jan 2012 18:29
Thank you WickedX, that fixed my problem.

When we all lend our power together, there is nothing we
can't do!
Please Lend me your STRENGTH!

Login to post a reply

Server time is: 2024-11-23 23:46:49
Your offset time is: 2024-11-23 23:46:49