WHILE BUTTON() would work only if you're pressing the designated button BEFORE the loop starts. Using REPEAT won't help, so try to sepparate the logic of the game from the functionality of the main loop. Just as @V360 shows.