Could you refer to the following codes?
@LOOP
VSYNC 1:K=BUTTON(2)
IF(K AND #DOWN)!=0 THEN BEEP 52
IF(K AND #LEFT)!=0 THEN BEEP 53
IF(K AND #RIGHT)!=0 THEN BEEP 25
IF(K AND #A)!=0 THEN BEEP 25,0,20
IF(K AND #B)!=0 THEN BEEP 52
IF(K AND #Y)!=0 THEN BEEP 53
GOTO @LOOP