forked from RetroBattlestations/HalloweenBoogaloo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AmstradCPC.txt
84 lines (84 loc) · 2.81 KB
/
AmstradCPC.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
100 REM BASIC Week 2: Halloween Boogaloo
110 REM http://reddit.com/r/RetroBattlestations
120 REM written by FozzTexx
130 REM Amstrad CPC Port by GSchizas
140 REM ----
200 REM Clear screen and setup variables
210 MODE 1
220 REM Integer variables are faster
230 DEFINT a-z
240 cl = 40:rw = 25:REM Columns and Rows of screen
300 REM Load background and draw on screen
310 GOSUB 1510
320 nr = sr:wd = sc:wx = -2
330 x = 2:kf = x + wd:IF RND > 0.5 THEN x = cl - wd - 2:kf = 0
340 y = rw - nr:kw = cl - wd - 4
350 GOSUB 2010
500 REM Load sprites into variables
510 GOSUB 1510:bt$(0) = sp$:be$ = se$:bc = sc
520 GOSUB 1510:bt$(1) = sp$
530 GOSUB 1510:wt$ = sp$:we$ = se$:ww = sc:wh = sr
600 REM Animation
610 nb = 3:wx = -2
620 FOR i = 1 TO nb
630 bx(i) = INT(RND * (kw - bc)):by(i) = INT(RND * ((rw - 4 - nr / 2) / nb)) * nb + i + 1
640 bw(i) = INT(RND * 2):bf(i) = INT(RND * 9)
650 NEXT i
660 FOR i = 1 TO nb
670 y = INT(bf(i) / 3):x = INT((bf(i) / 3 - y) * 3 + 0.05)
680 x = x + bx(i) + kf :y = y + by(i):sp$ = be$:GOSUB 2010
710 bw(i) = bw(i) + 1:IF bw(i) > 1 THEN bw(i) = 0
720 bf(i) = INT(RND * 9)
730 y = INT(bf(i) / 3):x = INT((bf(i) / 3 - y) * 3 + 0.05)
740 x = x + bx(i) + kf :y = y + by(i):sp$ = bt$(bw(i)):GOSUB 2010
750 IF wx = -1 THEN sp$ = we$:x = 0:y = 0:GOSUB 2010:wx = -2
760 IF wx >= 0 THEN sp$ = wt$:x = wx:y = 0:GOSUB 2010:wx = wx - 1
770 IF wx = -2 AND wh + nr < rw AND RND * 50 < 2 THEN wx = cl - ww - 1
780 NEXT i
790 GOTO 660
1000 REM Position cursor at X,Y
1010 LOCATE x+1,y+1
1020 RETURN
1500 REM Load a sprite from DATA into a string
1510 sp$ = "":se$ = "":sr = 0:sc = 0
1520 READ t$,s$:IF LEN(sp$) > 0 THEN sp$ = sp$ + CHR$(13)
1530 sp$ = sp$ + s$:sr = sr + 1:IF LEN(s$) > sc THEN sc = LEN(s$)
1540 bl$ = "":FOR i = 1 TO LEN(s$):bl$ = bl$ + " ":NEXT i
1550 IF LEN(se$) > 0 THEN se$ = se$ + CHR$(13)
1560 se$ = se$ + bl$
1570 IF t$ <> "SE" THEN GOTO 1520
1580 RETURN
2000 REM Draw sprite in SP$ at X,Y
2010 se = 1:sb = 1
2020 se = INSTR(sb, sp$, CHR$(13))
2030 IF se = 0 THEN se = LEN(sp$) + 1
2040 GOSUB 1010
2050 PRINT MID$(sp$, sb, se - sb);
2060 IF se >= LEN(sp$) THEN RETURN
2070 IF ASC(MID$(sp$, se)) = 13 THEN se = se + 1
2080 sb = se:y = y + 1:GOTO 2020
5000 DATA SP," ^"
5010 DATA SP," / \"
5020 DATA SP," //|\\"
5030 DATA SP," / -+- \"
5040 DATA SP," / \|/ \"
5050 DATA SP," /_________\"
5060 DATA SP," | ___ |"
5070 DATA SP," || | ||::::"
5080 DATA SP," /\ |-+-||IIII"
5090 DATA SP," / \|_|_|| \"
5100 DATA SP," / [] \ |_____"
5110 DATA SP,"/_____ | +-+|"
5120 DATA SP," | +--+ | |+||"
5130 DATA SP," | | | | +-+|"
5140 DATA SP," | |o | |____|"
5150 DATA SE," |___|__|_|"
5160 DATA SE,"^v^"
5170 DATA SE,"-v-"
5180 DATA SP," , "
5190 DATA SP," _/(_ "
5200 DATA SP," {\\ "
5210 DATA SP," /;_) "
5220 DATA SP,"=='/ <===<<< "
5230 DATA SP," \__\ "
5240 DATA SE," `` "