Skip to content

Commit

Permalink
AGC02: Movimientos del personaje en BASIC
Browse files Browse the repository at this point in the history
  • Loading branch information
lronaldo committed Jul 23, 2019
1 parent 4bca029 commit aaa2148
Showing 1 changed file with 61 additions and 30 deletions.
91 changes: 61 additions & 30 deletions basic/rpg.bas
Original file line number Diff line number Diff line change
@@ -1,30 +1,61 @@
10 '
20 ' MY BIG RPG PROJECT
30 ' by @FranGallegoBR
40 ' July 2019
50 '

100 ' INITIALIZE
110 DEFINT a-z
120 energy=100:attack=30:defense=15
130 energyen=90:attacken=20:defenseen=10:a$=""

200 ' PRESENTATION
210 MODE 1:PRINT"RPG GAME"
220 PRINT"PRESS ENTER TO START"
230 INPUT"",a$

300 ' PRINT GAME STATUS
310 CLS
320 PRINT"PLAYER ["energy"](a"attack")(d"defense")"
330 PRINT"ENEMY ["energyen"](a"attacken")(d"defenseen")"

400 ' PLAYER ACTIONS
410 INPUT"ACTION";a$
420 IF a$="A" THEN energyen=energyen-attack:GOTO 500
430 IF a$="D" THEN energy=energy+defense:GOTO 500
440 GOTO 400

500 ' ENEMY ACTIONS
510 IF RND>0.25 THEN energy=energy-attacken:GOTO 300
520 energyen=energyen+defenseen:GOTO 300
1 '
1 ' MY BIG RPG PROJECT
1 ' by @FranGallegoBR
1 ' July 2019
1 '

1 ' INITIALIZE
100 DEFINT a-z
110 e=100:a=30:d=15:x=5
120 ee=90:ea=20:ed=10:ex=7:a$=""

1 ' PRESENTATION
200 MODE 1:PRINT"RPG GAME"
210 GOSUB 10000

1 ' PRINT GAME STATUS
300 WHILE 1:CLS
310 PRINT"PLAYER ["e"](a"a")(d"d")"
320 PRINT"ENEMY ["ee"](a"ea")(d"ed")"
330 LOCATE x,6:PRINT CHR$(249)
340 LOCATE ex,6:PRINT CHR$(225)
350 PRINT STRING$(10,143):PRINT STRING$(10,127)

1 ' PLAYER ACTIONS
400 INPUT"ACTION";a$
410 IF a$="O" THEN GOSUB 1000:GOTO 500
420 IF a$="P" THEN GOSUB 1100:GOTO 500
430 IF a$="D" THEN GOSUB 1400:GOTO 500
450 GOTO 400

1 ' ENEMY ACTIONS
500 IF ex=x+1THEN GOSUB 1200 ELSE GOSUB 1300

900 GOSUB 10000:WEND

1 ' MOVE PLAYER LEFT
1000 x=x-1:IF x=0THEN x=1
1010 RETURN

1 ' MOVE PLAYER RIGHT
1100 x=x+1:IF x=ex THEN x=x-1:ee=ee-a:PRINT"PLAYER ATTACKS WITH FORCE:"a
1110 RETURN

1 ' ENEMY ATTACKS
1200 e=e-ea:PRINT"ENEMY ATTACKS WITH FORCE:"ea
1210 RETURN

1 ' ENEMY DEFENDS
1300 ee=ee+ed:PRINT"ENEMY RELOADS:"ed
1310 RETURN

1 ' PLAYER DEFENDS
1400 e=e+d:PRINT"PLAYER RELOADS:"d
1410 RETURN

1 ' PRESS ENTER TO CONTINUE
10000 PRINT"PRESS ENTER TO CONTINUE"
10010 INPUT"",a$
10020 RETURN

1

0 comments on commit aaa2148

Please sign in to comment.