Open bukeelcin opened 10 years ago
Firstly,it seems an error but it is not because we don't have gameOver() method yet. The only thing we are doing is that when the ball exits the frame, the numberoflives will decrease. In the next week, we are going to add gameOver() method and when the numberoflives become 0, the game will be over, then his parameter can't be less than zero anymore.
Here is my idea. Something like this. if (lives == 0) { move = false; or gameOver(); } if (lives == 0) { g.setColor(Color.WHITE); g.setFont(new Font("TimesRoman", Font.PLAIN, 20)); g.drawString("YOU LOSE!", 240, 300); }
I have solved this issue. In other words, I made game over part. I will update the code soon.
Number of lives can be less than 0, when you die frequently. Deniz, how are we going solve this because it does not make sense.