Board Thread:Questions and Answers/@comment-162.207.198.157-20150525140202/@comment-14600979-20150525142124

Woah woah.

So, usually, what you do for movement is say "When button change X/Y variable" for each button, then near the end of you main loop (a section of code like @MAIN .code. SPOFS 0,X,Y GOTO @MAIN )

Then in that, probably after the movement, you can say IF (BUTTON(0) AND 16) THEN GOSUB @SHOOT

At the end of the code for @SHOOT, place a RETURN so that it will return back to where @SHOOT was called.

So like

ACLS:CLEAR PNLTYPE "OFF" SPSET 0,177,8,0,0,0 SPANGLE 0,90 SPOFS 0,141,95 SPSET 1,47,5,0,0,0 SPOFS 1,125,95

@MAIN IF (BUTTON(0) AND 1) THEN Y=Y-5 IF (BUTTON(0) AND 2) THEN Y=Y+5 IF (BUTTON(0) AND 4) THEN X=X-5 IF (BUTTON(0) AND 8) THEN X=X+5 SPOFS X,Y IF (BUTTON(0) AND 16) THEN GOSUB @SHOOT GOTO @MAIN

@SHOOT SPREAD(0), X,Y SPOFS 1,X-16,-10,30 WAIT 30 SPOFS 1,X-16,Y RETURN