Quitting the game is easily done with STOP. END would do a similar thing, but it doesn't work inside functions.
Actually, I just came up with a really cool thing for you. Try this:
DEF A IF B2 AND #Y && !FADE() THEN FADE #BLACK,60 IF FADE()==#BLACK THEN ACLS:STOP END '(Then inside your main loop...) @LOOP VSYNC A GOTO @LOOPWhen you press Y, the game will fade out and once the screen is completely faded out, it ends the game. By the way, I keep putting my code inside functions, but if it confuses you, you can definitely just place all of your code in the main loop.