-
Notifications
You must be signed in to change notification settings - Fork 2
/
pacvb.bas
68 lines (65 loc) · 2.29 KB
/
pacvb.bas
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
1 cls:clr
4 random
6 decimal gd
8 pd$="l"
10 gx=10
20 gy=10
30 px=2
40 py=11
45 wall=43
49 gosub 5000
50 rem move ghost 1
55 gosub 1000
57 do 55,500
60 end
1000 rem ** Move Ghost 1
1002 g$=""
1004 v=gy*40+1024+gx:poke v,32
1005 v=gy-1*40+1024+gx:temp=peek(v)
1010 if temp<>wall and pd$<>"d" then g$="u"
1020 v=gy+1*40+1024+gx:temp=peek(v)
1030 if temp<>wall and pd$<>"u" then g$=g$+"d"
1050 v=gy*40+1024+gx+1:temp=peek(v)
1060 if temp<>wall and pd$<>"l" then g$=g$+"r"
1080 v=gy*40+1024+gx-1:temp=peek(v)
1090 if temp<>wall and pd$<>"r" then g$=g$+"l"
1100 rem ** Now we know what directions the ghost can move in
1110 rem ** g$="DL" means it can move down or left for example
1120 gd=rnd*len(g$)+1:gd=whole(gd)
1125 pd$=mid$(g$,gd,1)
1130 if pd$="u" then dec gy
1140 if pd$="d" then inc gy
1150 if pd$="l" then dec gx
1160 if pd$="r" then inc gx
1162 v=gy*40+1024+gx:poke v,65
1180 return
2000 rem
3000 rem
4000 rem
5000 print "++++++++++++++++++++++++++++++++++++++++";
5010 print "+*..+......+.........+++.....+.+++....*+";
5020 print "+.+++.++++.+.+++++++.+++.+++++.+++.+++.+";
5030 print "+.+.+.+....+.....++....+...+.+++.....+.+";
5040 print "+.....+.++...+.+....++.+.+...+++.+++.+.+";
5050 print "+++++.+.++++.+.++++.+..+.+++.+.+.+++.+.+";
5060 print "+...+.+.....+.....+.+.++...........+...+";
5070 print "+.+......+++.++++..*+.+..+.+++++++.+++.+";
5080 print "+.+.++++.++.......+++.+.++.+...........+";
5090 print "+.+.........++++........+..+.++++++.++++";
5100 print "+.+.+.+++...+....++--++.++++.+.........+";
5110 print "+...+.+...+.+.++.++++++......+.+.+.+.++.";
5120 print "+.+.+...+++.+.++.++++++.++++++.+...+.+.+";
5130 print "+.+...+.+...+...........+.++++.+++++.+.+";
5140 print "+.+.+++.+.+.+++.+++++++.+............+.+";
5150 print "+.+.....+.+.............++.+++++++++.+.+";
5160 print "+.++.++...+.+.+.++++++.....+.....+.....+";
5170 print "+.....+.+++.+.+........+++.+.+.+.+.+.+.+";
5180 print "+.+.+...+++.+.+.++++++.+...+.+.+.+.+.+.+";
5190 print "+.+...+.+++.+.+........+.+.+.+...+.+.+.+";
5200 print "+.+++.+.+++.+.+.++++++.+...+.+.+++.+.+.+";
5210 print "+*....+..................+...+.....+..*+";
5220 print "++++++++++++++++++++++++++++++++++++++++";
5225 for i=1024 to 2000:v=peek(i)
5226 if v=43 then poke i,160
5227 next:wall=160
5230 return