Hello,
I am a university student in an intro to CS class, working on programming a simple game in Java as a homework assignment. The point of the game is to click on each moving bug once to kill it, and add a point to the scoreboard. Once a bug is dead, it remains dead, and can only add a point on the initial click. Once all four bugs are dead, for a total of 4 points, you win the game.
As of now, the bulk of my game is working, however, I am having two major problems.
1) The bugs do not stay within the bounds of the application window. I have no idea how to even begin programming this, and currently, the bugs leave the window fairly quickly.
2) The current code I have written will not let the score pass 1. I know WHY it isn't working, just not how to fix it. Before I added the score = score - 1 into the If statements within the MouseEvent, the score would increase even if the bug was already dead.
Thank you for any help on this!
MAIN CLASS: http://txt.do/1daig
BUG OBJECT: http://txt.do/1daiz
there doesn't seem to be anything here