How would I put in collision into my game? Here's the code:
ACLS
XON EXPAD
SPDEF 0,0,0,16,32,16,16,1
SPDEF 1,16,0,16,32,16,16,1
SPDEF 2,32,0,16,32,16,16,1
SPDEF 3,0,0,16,32,16,16,9
SPDEF 4,16,0,16,32,16,16,9
SPDEF 5,32,0,16,32,16,16,9
LOAD "GRP4:SP",0
LOAD "GRP0:BG",0
SPSET 0,0
SPSCALE 0,2,2
X=50
Y=160
@0
IF X<28 THEN X=28
IF X>405 THEN X=405
IF Y<118 THEN Y=118
VSYNC
SPOFS 0,X,Y
IF BUTTON AND #RIGHT THEN GOSUB @MR1
IF BUTTON AND #LEFT THEN GOSUB @ML1
IF BUTTON AND #B THEN GOSUB @JUMP
GOTO @0
@MR1
ANIM=ANIM+2
IF ANIM==10 THEN SPCHR 0,0
IF ANIM==20 THEN SPCHR 0,1
IF ANIM==30 THEN SPCHR 0,0
IF ANIM==40 THEN SPCHR 0,2
IF ANIM>40 THEN ANIM=0
OLD=629:LFT=FALSE
X=X+2
RETURN
@ML1
ANIM=ANIM+2
IF ANIM==10 THEN SPCHR 0,3
IF ANIM==20 THEN SPCHR 0,4
IF ANIM==30 THEN SPCHR 0,3
IF ANIM==40 THEN SPCHR 0,5
IF ANIM>40 THEN ANIM=0
OLD=629:LFT=FALSE
X=X-2
RETURN
@JUMP
VSYNC 1.5
SPOFS 0,X,Y
IF BUTTON AND #RIGHT THEN GOSUB @MR1
IF BUTTON AND #LEFT THEN GOSUB @ML1
IF Y<118 THEN Y=118
Y=Y-6
VSYNC 1.5
SPOFS 0,X,Y
IF BUTTON AND #RIGHT THEN GOSUB @MR1
IF BUTTON AND #LEFT THEN GOSUB @ML1
IF Y<118 THEN Y=118
Y=Y-6
VSYNC 1.5
SPOFS 0,X,Y
IF BUTTON AND #RIGHT THEN GOSUB @MR1
IF BUTTON AND #LEFT THEN GOSUB @ML1
IF Y<118 THEN Y=118
Y=Y-6
VSYNC 1.5
SPOFS 0,X,Y
IF BUTTON AND #RIGHT THEN GOSUB @MR1
IF BUTTON AND #LEFT THEN GOSUB @ML1
IF Y<118 THEN Y=118
Y=Y-6
VSYNC 1.5
SPOFS 0,X,Y
IF BUTTON AND #RIGHT THEN GOSUB @MR1
IF BUTTON AND #LEFT THEN GOSUB @ML1
IF Y<118 THEN Y=118
Y=Y-6
VSYNC 1.5
SPOFS 0,X,Y
IF BUTTON AND #RIGHT THEN GOSUB @MR1
IF BUTTON AND #LEFT THEN GOSUB @ML1
IF Y<118 THEN Y=118
Y=Y-6
VSYNC 1.5
SPOFS 0,X,Y
IF BUTTON AND #RIGHT THEN GOSUB @MR1
IF BUTTON AND #LEFT THEN GOSUB @ML1
IF Y<118 THEN Y=118
Y=Y-6
VSYNC 1.5
SPOFS 0,X,Y
IF BUTTON AND #RIGHT THEN GOSUB @MR1
IF BUTTON AND #LEFT THEN GOSUB @ML1
IF Y<118 THEN Y=118
Y=Y+6
VSYNC 1.5
SPOFS 0,X,Y
IF BUTTON AND #RIGHT THEN GOSUB @MR1
IF BUTTON AND #LEFT THEN GOSUB @ML1
IF Y<118 THEN Y=118
Y=Y+6
VSYNC 1.5
SPOFS 0,X,Y
IF BUTTON AND #RIGHT THEN GOSUB @MR1
IF BUTTON AND #LEFT THEN GOSUB @ML1
IF Y<118 THEN Y=118
Y=Y+6
VSYNC 1.5
SPOFS 0,X,Y
IF BUTTON AND #RIGHT THEN GOSUB @MR1
IF BUTTON AND #LEFT THEN GOSUB @ML1
IF Y<118 THEN Y=118
Y=Y+6
VSYNC 1.5
SPOFS 0,X,Y
IF BUTTON AND #RIGHT THEN GOSUB @MR1
IF BUTTON AND #LEFT THEN GOSUB @ML1
IF Y<118 THEN Y=118
Y=Y+6
VSYNC 1.5
SPOFS 0,X,Y
IF BUTTON AND #RIGHT THEN GOSUB @MR1
IF BUTTON AND #LEFT THEN GOSUB @ML1
IF Y<118 THEN Y=118
Y=Y+6
VSYNC 1.5
SPOFS 0,X,Y
IF BUTTON AND #RIGHT THEN GOSUB @MR1
IF BUTTON AND #LEFT THEN GOSUB @ML1
IF Y<118 THEN Y=118
Y=Y+6
RETURN