Thank you all for your help.
I've finally finished my project.
Thanks a lot for all your help!
Type: Posts; User: 123099
Thank you all for your help.
I've finally finished my project.
Thanks a lot for all your help!
The problem was this line:
if(ball.getX() - (ball.getDiameter()/2)<p1.getX() + p1.getWidth() || ball.getX() + (ball.getDiameter()/2)> p1.getX()){
The expression was always true because i...
From the debugging I found the problem.
It always draws the ball at x - 0, y-1 and it never changes although the other functions are executed till the end.
The problem was that I've sent to the...
I'm always doing this, and when I did this all the ball methods execute normally till the end, but it just wont show on the screen.
And the results after modifying the code again were that the ball...
Oh right, I was using it before I have modified the code.
Ill check it and I'll post the results.
But the problem is, that I'm also using the drawMe function inside the class itself, thus I'll need to send a Graphics object within the class itself also each time I'm using the drawMe() function....
Here is the code.
But I have a problem, the ball won't draw, although it moves.
Main Class:
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
...
never mind solved this bu sending the main object to the racket class through the racket's constructor.
But if you have a better way to solve this please share.
ok thanks, but now I have another problem.
How can I use the reapint method through the Racket class without causing a recursion?
The problem is that I need to create a new Main object and then use...
I've changed the code as you said, but the rackets still refuse to move
this is the new codes(not a lot of difference)
Main:
/*
* To change this template, choose Tools | Templates
* and...
Main:
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package pongnew;
I'm making a small pong game, in which there are 2 rackets - 1 of them is moved y the up and down arrows by the user.
Now, the problem is that when I'm pressing the up and down keys the racket won't...