Skip to content

Instantly share code, notes, and snippets.

@powerswitch
Created July 10, 2012 17:00
Show Gist options
  • Save powerswitch/3084712 to your computer and use it in GitHub Desktop.
Save powerswitch/3084712 to your computer and use it in GitHub Desktop.
Bergsteigersimulator
RANDOMIZE TIMER
CLS
SCREEN 13
FOR y = 200 TO 10 STEP -1
x = x + FIX(RND * 4)
IF x > 160 THEN EXIT FOR
LINE (x, y)-(320 - x, y), 8
NEXT
FOR y = 200 TO 10 STEP -1
FOR x = 1 TO 320
z = POINT(x, y)
IF z = 8 THEN PSET (x, y), FIX(RND * 10) + 21
NEXT
NEXT
LINE (0, 0)-(50, 10), 15, B
LINE (269, 0)-(319, 10), 15, B
LINE (1, 1)-(49, 9), 15, BF
LINE (270, 1)-(318, 9), 15, BF
FOR a = 1 TO 48
b = b + .1
LINE (a, 1)-(a, 9), 40 + b
LINE (319 - a, 1)-(319 - a, 9), 40 + b
NEXT
mpx = 5
mpy = 30
DO
OPEN "VGABERG.ber" FOR INPUT AS #1
FOR y = 1 TO 9
FOR x = 1 TO 3
INPUT #1, z
IF z <> 0 THEN PSET (x + mpx, y + mpy), z
NEXT
NEXT
CLOSE #1
test = POINT(mpx + 2, mpy + 10)
mpy = mpy + 1
LOOP WHILE test = 0
hunger = 48
durst = 48
LOCATE 5, 1
PRINT "1 Limonade"
PRINT "2 Keks"
PRINT "3 Hamburger"
PRINT "4 Wurst"
DO WHILE mpx < 300
1
LINE (1, 1)-(49, 9), 0, BF
LINE (270, 1)-(318, 9), 0, BF
b = 0
FOR a = 1 TO hunger
b = b + .1
LINE (a, 1)-(a, 9), 40 + b
NEXT
b = 0
FOR a = 1 TO durst
b = b + .1
LINE (319 - a, 1)-(319 - a, 9), 40 + b
NEXT
OPEN "VGABERG.ber" FOR INPUT AS #1
FOR y = 1 TO 9
FOR x = 1 TO 3
INPUT #1, z
IF z <> 0 THEN PSET (x + mpx, y + mpy), z
NEXT
NEXT
CLOSE #1
SLEEP 1
LINE (mpx + 1, mpy + 1)-(mpx + 3, mpy + 9), 0, BF
SELECT CASE INKEY$
CASE CHR$(27): END
CASE CHR$(0) + "M"
IF hunger > 1 AND durst > 1 THEN
hunger = hunger - 2
durst = durst - 3
FOR a = mpy TO mpy + 20
t = POINT(mpx + 4, a)
IF t <> 0 THEN
mpx = mpx + 4
mpy = a - 8
GOTO 1
END IF
t = POINT(mpx + 8, a)
IF t <> 0 THEN
mpx = mpx + 4
mpy = a - 8
GOTO 1
END IF
NEXT
END IF
CASE "3"
OPEN "VGABERG.ham" FOR INPUT AS #1
FOR y = 1 TO 10
FOR x = 1 TO 10
INPUT #1, z
IF z <> 0 THEN PSET (x + ep, y + 20), z
NEXT
NEXT
CLOSE #1
ep = ep + 10
hunger = hunger + 12
kosten = kosten + .15#
IF ep > 170# THEN GOTO platzen
IF hunger > 49 THEN hunger = 49
LOCATE 3, 2: PRINT kosten; "Euro "
CASE "4"
OPEN "VGABERG.wur" FOR INPUT AS #1
FOR y = 1 TO 10
FOR x = 1 TO 10
INPUT #1, z
IF z <> 0 THEN PSET (x + ep, y + 20), z
NEXT
NEXT
CLOSE #1
ep = ep + 10
hunger = 48#
kosten = kosten + .5#
IF ep > 170# THEN GOTO platzen
IF hunger > 49 THEN hunger = 49
LOCATE 3, 2: PRINT kosten; "Euro "
CASE "1"
OPEN "VGABERG.was" FOR INPUT AS #1
FOR y = 1 TO 10
FOR x = 1 TO 10
INPUT #1, z
IF z <> 0 THEN PSET (x + ep, y + 20), z
NEXT
NEXT
CLOSE #1
ep = ep + 10
durst = durst + 40
kosten = kosten + .15#
IF ep > 170# THEN GOTO platzen
IF durst > 49 THEN durst = 49
LOCATE 3, 2: PRINT kosten; "Euro "
CASE "2"
OPEN "VGABERG.kek" FOR INPUT AS #1
FOR y = 1 TO 10
FOR x = 1 TO 10
INPUT #1, z
IF z <> 0 THEN PSET (x + ep, y + 20), z
NEXT
NEXT
CLOSE #1
ep = ep + 10
hunger = hunger + 15
kosten = kosten + .15#
IF ep > 170# THEN GOTO platzen
IF hunger > 49 THEN hunger = 49
LOCATE 3, 2: PRINT kosten; "Euro "
CASE ELSE
hunger = hunger - .3
durst = durst - .5
END SELECT
LOOP
END
platzen:
LOCATE 1, 15: PRINT "Geplatzt!"
FOR a = 1 TO 1000
x = FIX(RND * 5)
y = FIX(RND * 10)
c = FIX(RND * 4)
PSET (mpx + x, mpy + y), 40 + c
FOR b = 1 TO 1000: NEXT
NEXT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment