public void check(){ if(getOneIntersectingObject(Scanner.class) != null && !checked){ checked = true; System.out.println(Scanner.lastNum); if((input-Scanner.lastNum) < input&&Scanner.lastNum == Scanner.lastNum++){ getWorld().addObject(new GameOver(), 405, 310); Greenfoot.stop(); } Scanner.lastNum++; } }