This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Bad Bounce Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Bad Bounce" Watch "Bad Bounce" New topic
Author

Bad Bounce

Peter Powers
Greenhorn

Joined: Jan 10, 2013
Posts: 13
Hello, I am working through the Stanford java You tube series, and am currently on the Breakout game - got it working fine except for one very irritating thing. When the ball bounces off the paddle it goes through the paddle then bounces as only the top left coordinates of the GOval ball is being read. Why are the rest being ignored?- Thanks in advance .. been pulling my hair our for hours.... suspect code below..



PS - could it be the paddle?

Stevens Miller
Bartender

Joined: Jul 26, 2012
Posts: 772
    
    7

Does getElementAt ever return null?
Peter Powers
Greenhorn

Joined: Jan 10, 2013
Posts: 13
Yes it does, I checked that by inserting an if null - system.out print.
Peter Powers
Greenhorn

Joined: Jan 10, 2013
Posts: 13
Found the problem.... need to update ball position.
Stevens Miller
Bartender

Joined: Jul 26, 2012
Posts: 772
    
    7

Peter Powers wrote:Found the problem.... need to update ball position.

That was going to be my next suggestion.
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Bad Bounce
 
It's not a secret anymore!