KaranMohindroo / Flappy-Bird

Java based game
1 stars 0 forks source link

Drogon Crosses the Upper/Lower boundary #2

Closed KaranMohindroo closed 6 years ago

KaranMohindroo commented 6 years ago

When dragon crosses the top or falls below (between the pipes) the game should end but it doesn't

afylers commented 6 years ago

I think there is problem in https://github.com/KaranMohindroo/Flappy-Bird/blob/master/FlappyBird.java#L99

if(bird.y > HEIGHT || bird.y+bird.RAD < 0) {

                game = false;

            }

it should be

 if(bird.y > HEIGHT || bird.y+bird.RAD < 0) {
                JOptionPane.showMessageDialog(frame, "You lose!\n"+"Your score was: "+time/60+".");
                game = false;
                if(hs<time/60)
                {
                    hs=time/60;
                }
            }
KaranMohindroo commented 6 years ago

Issue Solved