Game made by Sergio Menegon. Works for iPad in Portrait.
10 SCREEN 1:CLS
20 G=25
30 VX=10:VY=0:X=400:Y=200:DT=0.1:R2=60:R1=10
35 LX=100:HX=600:LY=100:HY=1000:GR=800
40 AT=2.5:WC=15:PC=WC:SP=100:DF=1.5:PU=0:BC=1.2
50 OK=0:VI=3:PV=20:RB=0:RV=2:EV$="":R=R2
1000 REM -----------------------
1010 REM MAIN CICLE
1020 REM -----------------------
1045 REM COLLISION DETECTION
1050 IF Y+R>GR THEN GOSUB 15000
1055 IF Y-R<LY THEN GOSUB 15500
1060 IF (X-R<LX OR X+R>HX) THEN GOSUB 17000
1065 VY=VY+(G-SGN(VY)*AT)*DT
1068 Y=Y+VY*DT:X=X+VX*DT
1070 BEGINFRAME:CLS
1080 LINE LX,GR,HX,GR,9
1082 FRAME LX,LY,HX,HY,1
1085 LINE LX,GR-BC*2*R,HX,GR-BC*2*R,16:REM BONUS
1090 CIRCLE X,Y,R,8,1
1100 IF PC>0 THEN PC=PC-1:GOSUB 13000
1105 GPRINT "Bonus line",LX,GR-BC*2*R-10,1
1110 GPRINT "Good! :"+STR$(OK),LX,GR+R2+30,16
1115 GPRINT "Bad! :"+STR$(RB),LX,GR+R2+60,16
1120 GPRINT "Life :"+STR$(VI),LX,GR+R2+90,16
1130 GPRINT "Score :"+STR$(PU),LX,GR+R2+120,1
1210 ENDFRAME
1990 GOSUB 10000
1999 GOTO 1000
10000 REM -----------------------------
10001 REM TAP DETECT: OUT IN XT E YT
10002 REM ----------------------------
10030 XT=PEEK(1030)+256*PEEK(1031)
10040 YT=PEEK(1032)+256*PEEK(1033)
10045 PK=PEEK(1024)
10050 IF PK=1 THEN POKE 1024,0:PK=0:GOSUB 12000
10999 RETURN
12000 REM ------------------------
12010 REM TAP POSITION ANALISYS
12020 REM ------------------------
12030 DX=XT-X:DY=YT-Y
12040 DS=SQR(DX^2+DY^2)
12050 IF DS<R THEN GOSUB 14000
12999 RETURN
13000 REM ------------------------
13010 REM PRINT EVENT
13020 REM ------------------------
13025 IF Y-R<0 THEN RETURN
13030 GPRINT EV$,X+R,Y-R,1
13100 RETURN
14000 REM ------------------------
14010 REM TAP OK!
14020 REM ------------------------
14030 PC=5:EV$="Good!"
14040 VY=-SP
14050 VX=-DF*DX
14060 OK=OK+1:R=R-2:PU=PU+10
14065 IF R<R1 THEN R=R1:G=G+1
14070 IF OK>PV THEN VI=VI+1:OK=0:EV$="Good! (+1 life)"
14080 IF Y>GR-BC*2*R+R THEN EV$=EV$+" BONUS SCORE (+100)! ":PU=PU+100:PC=25
14999 RETURN
15000 REM ------------------------
15010 REM GROUND
15020 REM ------------------------
15100 VY=-VY+AT:Y=GR-R-1
15105 PC=25:EV$="Very Bad! (-1 life)":OK=0
15110 VI=VI-1
15120 IF VI=0 GOTO 16000: REM GAME OVER
15499 RETURN
15500 REM ------------------------
15510 REM TOP
15520 REM ------------------------
15530 Y=LY+R: VY=-VY
15540 PC=25:EV$="Too high! (-1 life)":OK=0
15550 VI=VI-1
15560 IF VI=0 GOTO 16000: REM GAME OVER
15999 RETURN
16000 REM ------------------------
16010 REM GAME OVER
16020 REM ------------------------
16030 GPRINT "GAME OVER",(HX-LX)/2,(HY-LY)/2,16
16035 GPRINT "Score:"+STR$(PU),(HX-LX)/2,(HY-LY)/2+30,1
16040 SLEEP 2000
16050 SCREEN 0:CLS
16060 INPUT "Play again (y/n)";R$
16070 IF R$="y" OR R$="Y" THEN GOTO 10
16080 CLS: PRINT "Ok, bye!"
16090 PRINT "Written by Sergio Menegon - Italy"
16100 END
17000 REM ------------------------
17001 REM BORDER
17005 REM ------------------------
17010 VX=-VX:RB=RB+1:PC=10:EV$="Bad!":OK=0
17020 IF RB>RV THEN VI=VI-1:RB=0:EV$="Bad (-1 life):pc=25
17030 IF VI=0 GOTO 16000: REM GAME OVER
17999 RETURN
20 G=25
30 VX=10:VY=0:X=400:Y=200:DT=0.1:R2=60:R1=10
35 LX=100:HX=600:LY=100:HY=1000:GR=800
40 AT=2.5:WC=15:PC=WC:SP=100:DF=1.5:PU=0:BC=1.2
50 OK=0:VI=3:PV=20:RB=0:RV=2:EV$="":R=R2
1000 REM -----------------------
1010 REM MAIN CICLE
1020 REM -----------------------
1045 REM COLLISION DETECTION
1050 IF Y+R>GR THEN GOSUB 15000
1055 IF Y-R<LY THEN GOSUB 15500
1060 IF (X-R<LX OR X+R>HX) THEN GOSUB 17000
1065 VY=VY+(G-SGN(VY)*AT)*DT
1068 Y=Y+VY*DT:X=X+VX*DT
1070 BEGINFRAME:CLS
1080 LINE LX,GR,HX,GR,9
1082 FRAME LX,LY,HX,HY,1
1085 LINE LX,GR-BC*2*R,HX,GR-BC*2*R,16:REM BONUS
1090 CIRCLE X,Y,R,8,1
1100 IF PC>0 THEN PC=PC-1:GOSUB 13000
1105 GPRINT "Bonus line",LX,GR-BC*2*R-10,1
1110 GPRINT "Good! :"+STR$(OK),LX,GR+R2+30,16
1115 GPRINT "Bad! :"+STR$(RB),LX,GR+R2+60,16
1120 GPRINT "Life :"+STR$(VI),LX,GR+R2+90,16
1130 GPRINT "Score :"+STR$(PU),LX,GR+R2+120,1
1210 ENDFRAME
1990 GOSUB 10000
1999 GOTO 1000
10000 REM -----------------------------
10001 REM TAP DETECT: OUT IN XT E YT
10002 REM ----------------------------
10030 XT=PEEK(1030)+256*PEEK(1031)
10040 YT=PEEK(1032)+256*PEEK(1033)
10045 PK=PEEK(1024)
10050 IF PK=1 THEN POKE 1024,0:PK=0:GOSUB 12000
10999 RETURN
12000 REM ------------------------
12010 REM TAP POSITION ANALISYS
12020 REM ------------------------
12030 DX=XT-X:DY=YT-Y
12040 DS=SQR(DX^2+DY^2)
12050 IF DS<R THEN GOSUB 14000
12999 RETURN
13000 REM ------------------------
13010 REM PRINT EVENT
13020 REM ------------------------
13025 IF Y-R<0 THEN RETURN
13030 GPRINT EV$,X+R,Y-R,1
13100 RETURN
14000 REM ------------------------
14010 REM TAP OK!
14020 REM ------------------------
14030 PC=5:EV$="Good!"
14040 VY=-SP
14050 VX=-DF*DX
14060 OK=OK+1:R=R-2:PU=PU+10
14065 IF R<R1 THEN R=R1:G=G+1
14070 IF OK>PV THEN VI=VI+1:OK=0:EV$="Good! (+1 life)"
14080 IF Y>GR-BC*2*R+R THEN EV$=EV$+" BONUS SCORE (+100)! ":PU=PU+100:PC=25
14999 RETURN
15000 REM ------------------------
15010 REM GROUND
15020 REM ------------------------
15100 VY=-VY+AT:Y=GR-R-1
15105 PC=25:EV$="Very Bad! (-1 life)":OK=0
15110 VI=VI-1
15120 IF VI=0 GOTO 16000: REM GAME OVER
15499 RETURN
15500 REM ------------------------
15510 REM TOP
15520 REM ------------------------
15530 Y=LY+R: VY=-VY
15540 PC=25:EV$="Too high! (-1 life)":OK=0
15550 VI=VI-1
15560 IF VI=0 GOTO 16000: REM GAME OVER
15999 RETURN
16000 REM ------------------------
16010 REM GAME OVER
16020 REM ------------------------
16030 GPRINT "GAME OVER",(HX-LX)/2,(HY-LY)/2,16
16035 GPRINT "Score:"+STR$(PU),(HX-LX)/2,(HY-LY)/2+30,1
16040 SLEEP 2000
16050 SCREEN 0:CLS
16060 INPUT "Play again (y/n)";R$
16070 IF R$="y" OR R$="Y" THEN GOTO 10
16080 CLS: PRINT "Ok, bye!"
16090 PRINT "Written by Sergio Menegon - Italy"
16100 END
17000 REM ------------------------
17001 REM BORDER
17005 REM ------------------------
17010 VX=-VX:RB=RB+1:PC=10:EV$="Bad!":OK=0
17020 IF RB>RV THEN VI=VI-1:RB=0:EV$="Bad (-1 life):pc=25
17030 IF VI=0 GOTO 16000: REM GAME OVER
17999 RETURN
No comments:
Post a Comment