Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need help with game

 
Krupa Patel
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to move the ball on the drawing panel. My code seems correct but when I run it, nothing is happening.
Can anyone please tell me what I am doing wrong?
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
perhaps the Ball class needs some code here

 
Krupa Patel
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's still not working. please give me some hints.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
honestly, you will have to develop some debugging skills.

I pointed you to the empty method move(), so you added some code to move() which included this line:
this.setLocation(nextX, nextY);

now take a look at setLocation() - what do you expect it to do?

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic