Re: how do i put an image as a background on a JFrame?
- From: Philipp <sicsicsic@xxxxxxxxxxx>
- Date: Sun, 15 Apr 2007 13:54:18 +0200
Knute Johnson wrote:
Andrew Thompson wrote:Knute Johnson wrote:
.
www.knutejohnson.com
Hey, cool. When did you get the domain name?
BTW - love the sounds you put to 'Pong', they cracked me up. :-)
I've had it for a while but I linked it up a couple of months ago.
I told Jeff Higgins, my wife hates the sounds and leaves the room whenever I play the game :-).
I got a little bug while playing. When the ball hits an upper corner more or less exactly (depends on speed), it stays glued to the top line. This is because the following Y condition
// if ball is hitting top bounce off
} else if (ballY <= 0) {
veloY = -veloY;
bink.play();
}
Should not be "else" to the X condition.
If the ball crosses both conditions (X&Y) in the same step, the veloY will be added twice to ballY before the Y condition is evaluated and so the condition (ballY <= 0) will now be true forever (with the veloY changing sign at each frame).
So take out this "else".
:-)
Phil
.
- Follow-Ups:
- Re: how do i put an image as a background on a JFrame?
- From: Knute Johnson
- Re: how do i put an image as a background on a JFrame?
- References:
- how do i put an image as a background on a JFrame?
- From: apoullakkos
- Re: how do i put an image as a background on a JFrame?
- From: Knute Johnson
- Re: how do i put an image as a background on a JFrame?
- From: Knute Johnson
- how do i put an image as a background on a JFrame?
- Prev by Date: Re: how do i put an image as a background on a JFrame?
- Next by Date: Re: how do i put an image as a background on a JFrame?
- Previous by thread: Re: how do i put an image as a background on a JFrame?
- Next by thread: Re: how do i put an image as a background on a JFrame?
- Index(es):
Relevant Pages
|