gvbasic吧 关注:95贴子:679
  • 4回复贴,共1

【转载】GVBASIC版下100层 源代码 游戏

只看楼主收藏回复

1 P$="wssccc game":LOCATE 2,1
2 FOR I=1 TO LEN(P$)
3 PRINT MID$(P$,I,1);
4 NEXT:SC=0:VO=1:TP$=INKEY$:GRAPH:CLS:OBX=179:OBY=79
7 OPEN "DOWNDIS" FOR INPUT AS #1:FOR I = 1 TO 4:INPUT #1,N$(I),S(I):PRINT N$(I)+" "+STR$(S(I))
8 NEXT:CLOSE #1:TP$=INKEY$
9 GRAPH:A=1:R=3:HP=50
10 FOR I=1 TO 5
20 TX(I)=RND(1)*60
30 TY(I)=I*16
40 NEXT:TY(0)=160
50 BX=TX(4)+10
60 BY=TY(4)-3
70 VO=1+SC/30:P=0:NS=0:FOR I = 1 TO 5
71 IF BY<TY(I)+VO AND BX>TX(I) AND BX<TX(I)+21+R AND TY(I)<TY(NS) THEN NS=I
72 NEXT :IF PEEK(194)=247 THEN LOCATE 3,8:PRINT "PAUSE":TP$=INKEY$:CLS
73 IF P=0 AND PEEK(192)=247 THEN BX=BX+VO+2:P=1
74 IF P=0 AND PEEK(198)=191 THEN BX=BX-VO-2:P=1
89 IF TY(NS)-BY-V<=1 THEN BY=TY(NS)-1-VO:C=1:GOTO 130
110 BY=BY+V:C=0:IF BY>90 THEN GOTO 180
130 FOR I=1 TO 5
140 TY(I)=TY(I)-VO:IF TY(I)>0 THEN GOTO 160
150 BOX TX(I),TY(I)+VO,TX(I)+20,TY(I)+3+VO,1,0:TY(I)=80:TX(I)=RND(1)*60
151 K=RND(1)*5
152 IF INT(K) = I THEN TS(I)=-5 ELSE TS(I)= 1
160 NEXT
170 IF C=0 THEN V=V+A
180 IF NOT (BY>90 OR BY<2*R) THEN GOTO 190
181 V=0:DP=6:HP=HP-5:FOR I = 1 TO 6
182 IF TY(I)>TY(DP) THEN DP=I
183 NEXT:BY=TY(DP)-VO-1:BX=TX(DP)+10
190 IF C=1 AND V>0 THEN HP=HP+TS(NS):V=0:SC=SC+1
191 IF HP>50 THEN HP =50
200 IF HP<0 THEN GOTO 290


1楼2014-02-11 19:42回复
    211 LOCATE 1,1:PRINT SC:BOX 40,0,120,5,1,0
    218 CIRCLE OBX+40,OBY-R,R,1,0
    219 CIRCLE BX+40,BY-R,R,1:OBY=BY:OBX=BX
    220 FOR I = 1 TO 5
    221 BOX TX(I)+40,TY(I)+VO-1,TX(I)+60,TY(I)+VO+4,1,0
    230 IF TS(I)>=0 THEN BOX TX(I)+40,TY(I),TX(I)+60,TY(I)+2,1
    231 IF TS(I)<0 THEN BOX TX(I)+40,TY(I),TX(I)+60,TY(I)+2,0
    240 NEXT
    251 BOX 3,43,37,50,1
    252 5,45,30*HP/50+5,48,1,0
    280 GOTO 70
    290 FOR I = 1 TO 5
    300 IF SC >S(6-I) THEN IX =I
    310 NEXT :IX=6-IX
    311 IF IX >4 THEN END
    320 FOR I = 1 TO 5-IX
    330 N$(6-I)=N$(5-I):S(6-I)=S(5-I)
    340 NEXT :CLS:TEXT
    350 INPUT "YOUR NAME:";NM$:GRAPH
    360 N$(IX)=NM$
    370 S(IX)=SC
    380 OPEN "DOWNHIS" FOR OUTPUT AS #1
    390 FOR I= 1 TO 5
    391 IF N$(I)="" THEN N$(I)="NO NAME"
    400 WRITE #1,N$(I),S(I)
    410 NEXT
    420 CLOSE #1:CLS
    430 GOTO 1


    2楼2014-02-11 19:42
    收起回复


      3楼2014-02-11 22:17
      回复


        IP属地:上海来自Android客户端4楼2022-04-03 18:27
        回复