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 / You saying theres something wrong with my code, you correct

Author
Message
Mr Monkey Man
20
Years of Service
User Offline
Joined: 22nd Feb 2004
Location: UK
Posted: 14th Apr 2004 13:12
Im making a pong game to help me get to grips with Dark Basic and I have the collision for one paddle working and used to the same technique on the edges of the court and the other paddle but the collision won't work for those objects. Please help heres the code for the game. Thankyou


*For every problem you come across you gain something from correcting it, I hope.
medwayman
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: uk
Posted: 14th Apr 2004 18:49
The only reason the ball bounces off the fist paddle is this line is wrong - ballangle#= = object angle y(4) - You have two equals in this line so ballangle# always =0.

You need to look at all of the collision again. You need to slow the ball movement and print values to the screen so you can see what’s going on.

Examples:
Move object 4,0.01
Text 10,10,str$(ballangle#)

Based on Amiga PD game Squigs. Early shots: http://www.custardsoft.pwp.blueyonder.co.uk/images/03.png

Mr Monkey Man
20
Years of Service
User Offline
Joined: 22nd Feb 2004
Location: UK
Posted: 15th Apr 2004 12:21
I followed your advice to find out what was going on. I edited the code slightyly and found that the collision between the shere and the second paddle were not being picked up by the computer and more advice for me out there. Thankyou



*For every problem you come across you gain something from correcting it, I hope.

Login to post a reply

Server time is: 2024-11-26 12:48:25
Your offset time is: 2024-11-26 12:48:25