Open KaranMohindroo opened 6 years ago
I have modified the collision code maybe it is working better than before
if(r.contains(bird.x+60, bird.y+50)) { JOptionPane.showMessageDialog(frame, "You lose!\n"+"Your score was: "+time/60+"."); game = false; if(hs<time/60) { hs=time/60; } } if(r.contains(bird.x-60, bird.y-50)) { JOptionPane.showMessageDialog(frame, "You lose!\n"+"Your score was: "+time/60+"."); game = false; if(hs<time/60) { hs=time/60; } }
https://github.com/KaranMohindroo/Flappy-Bird/blob/master/FlappyBird.java#L81
When the dragon collides with the pipe's head game should end but it doesn't. Below is the code for collision. Which is not working as expected
https://github.com/KaranMohindroo/Flappy-Bird/blob/master/FlappyBird.java#L76