When i try to do this all the lives go to zero and it gets a game over.... i think it has to do with the fact that it is still in contact with the alien so it does it again but i dont know how to fix it...
if(getOneIntersectingObject(Alien.class) != null) { lives -= 1; } if(lives == 0) { JOptionPane.showMessageDialog(null, "Your score was: " + totalCount); Space.canStart = (0); startbutton.destructother = (0); Greenfoot.stop(); return; }