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 / Yet another breakout question

Author
Message
Krad2004
19
Years of Service
User Offline
Joined: 8th Mar 2005
Location:
Posted: 21st Mar 2005 04:35
hi, i'm a real noob and i've picked breakout as my first 2d project

i cant get my ball to move when the mouse button is clicked
here is my code:


i had the ball moving once but when i stuck it to the paddle at the start of the game and used mouseclick() the ball just moves with the paddle.

can someone help???

Thanx
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 22nd Mar 2005 00:05
1) You are only recalculating the ball position variables when the mouse is clicked, here;


2) Your ball sprite only moves with the mouse, here;



Fix these two. You might still have a problem. If so, just ask on this same thread.

"Droids don't rip your arms off when they lose." -H. Solo

REALITY II
Krad2004
19
Years of Service
User Offline
Joined: 8th Mar 2005
Location:
Posted: 22nd Mar 2005 05:10
thanks for the help , but now the ball starts without me clicking the mouse button and dosn't collide with anything, even the screen edges
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 23rd Mar 2005 02:00
Post what you have now.

"Droids don't rip your arms off when they lose." -H. Solo

REALITY II
Soy Cocktail
20
Years of Service
User Offline
Joined: 23rd Dec 2003
Location:
Posted: 23rd Mar 2005 16:04
Breakout sounded like a fun game to remake, so I did. It took me about 2 hours to code it. Longer than it should have, and it still isin't done yet. I still need to add in losing, winning,scoring, and make the ball bounce diffrently depending on where it hits on the paddle. Just thought I would post the code that I do have so that you can look at it if you get stuck. I dont comment my programs well so it might be a bit hard to understand it. If you post what you don't understand I will try to help explain it better.

The source code is in the box that says source below my post.

When life hands you lemons go buy some oranges to make orange juice, and stop expecting everything to be given to you.
Krad2004
19
Years of Service
User Offline
Joined: 8th Mar 2005
Location:
Posted: 23rd Mar 2005 16:19 Edited at: 23rd Mar 2005 16:21
this is what i have now:


thanks for the help guys

Login to post a reply

Server time is: 2024-09-23 15:31:23
Your offset time is: 2024-09-23 15:31:23