(published: Sep. 13, 2000)
ACTIVE BASICにはゲームを作るときに便利な、 画面上に書かれた文字を読む機能 が無いので、結構不便です。 それを何とかカバーできないかと考えながら作ったゲームがこれです。
"#"を動かして敵に見つからないように "*"を取って下さい。 見つかるとゲームオーバーで、 "*"を取った数が表示されます。
カーソルキー:8方向移動
壁を挟んでいれば敵には見つかりません。
敵の向きに注意してください。
壁を挟まずに並んでも、敵が"#"の方向を向いていなければ 見つかることはありません。
1 randomize
5 dim h%(10),v%(10),q%(10),m%(16,16)
10 cls
12 for l1%=0 to 16
14 for l2%=0 to 16
16 m%(l1%,l2%)=0
18 next l2%
20 next l1%
21 x%=15:y%=15:s%=0:f%=0:g%=0
22 for l%=0 to 16
24 locate l%, 0:print "H";:m%(l%, 0)=1
26 locate l%,16:print "H";:m%(l%,16)=1
28 locate 0,l%:print "H";:m%( 0,l%)=1
30 locate 16,l%:print "H";:m%(16,l%)=1
32 next l%
34 for l1%=2 to 14 step 2
36 for l2%=2 to 14 step 2
38 locate l1%,l2%:print "H";:m%(l1%,l2%)=1
40 next l2%
42 next l1%
44 for l%=1 to 10
46 h%(l%)=1:v%(l%)=1:q%(l%)=1
48 next l%
50 locate 18,1:print "recon 1"
52 locate 18,2:print "[cursor]: move"
54 locate 18,4:print "by Nisino Tatami"
56 locate 18,6:print "push [spc]"
58 i$=inkey$:if i$<>" " then 58
60 locate 18,6:print " "
90 gosub 400
100 x0%=0:y0%=0
110 if keystate(28)<0 then x0%= 1
115 if keystate(29)<0 then x0%=-1
120 if keystate(31)<0 then y0%= 1
125 if keystate(30)<0 then y0%=-1
126 if m%(x%+x0%,y%+y0%)<>1 then 130
127 if m%(x%+x0%,y% )<>1 then y0%=0:goto 130
128 if m%(x% ,y%+y0%)<>1 then x0%=0:goto 130
129 x0%=0:y0%=0
130 locate x%+x0%,y%+y0%:print "#";
140 if x0%<>0 or y0%<>0 then locate x%,y%:print " ";
150 x%=x%+x0%:y%=y%+y0%
152 if m%(x%,y%)=0 then 160
154 m%(x%,y%)=0:s%=s%+1
156 gosub 400
160 for l%=1 to 4
170 d%=int(rnd(1)*5)+1:h0%=0:v0%=0
175 on d% goto 180,185,190,195,200
180 if m%(h%(l%)+1,v%(l%) )<>1 and q%(l%)<>2 then h0%= 1:q%(l%)=1
182 goto 200
185 if m%(h%(l%)-1,v%(l%) )<>1 and q%(l%)<>1 then h0%=-1:q%(l%)=2
187 goto 200
190 if m%(h%(l%) ,v%(l%)+1)<>1 and q%(l%)<>4 then v0%= 1:q%(l%)=3
192 goto 200
195 if m%(h%(l%) ,v%(l%)-1)<>1 and q%(l%)<>3 then v0%=-1:q%(l%)=4
200 locate h%(l%)+h0%,v%(l%)+v0%:print mid$("><VA",q%(l%),1);
210 if h0%<>0 or v0%<>0 then locate h%(l%),v%(l%):print mid$(" #*",m%(h%(l%),v%(l%))+1,1);
220 h%(l%)=h%(l%)+h0%:v%(l%)=v%(l%)+v0%
230 if h%(l%)<>x% or csng(x%)/2=int(csng(x%)/2) then 235
231 if q%(l%)=3 and v%(l%)<y% then f%=1:g%=l%
232 if q%(l%)=4 and v%(l%)>y% then f%=2:g%=l%
235 if v%(l%)<>y% or csng(y%)/2=int(csng(y%)/2) then 240
236 if q%(l%)=1 and h%(l%)<x% then f%=3:g%=l%
237 if q%(l%)=2 and h%(l%)>x% then f%=4:g%=l%
240 next l%
260 if f%=0 then 100
261 for l%=1 to 15
262 on f% goto 263,265,267,269
263 if v%(g%)+l%<16 then locate h%(g%) ,v%(g%)+l%:print "|";
264 goto 270
265 if v%(g%)-l%> 0 then locate h%(g%) ,v%(g%)-l%:print "|";
266 goto 270
267 if h%(g%)+l%<16 then locate h%(g%)+l%,v%(g%) :print "-";
268 goto 270
269 if h%(g%)-l%> 0 then locate h%(g%)-l%,v%(g%) :print "-";
270 next l%
275 locate 0,0:print "score ";s%;" "
280 locate 10,10:print "retr[y]/e[n]d"
290 i$=inkey$
300 if i$="y" then 10
310 if i$<>"n" then 290
320 end
400 p%=int(rnd(1)*6)*2+3:q%=int(rnd(1)*6)*2+3
410 m%(p%,q%)=2
420 for l%=1 to 4
422 if h%(l%)=p% and v%(l%)=q% then h%(l%)=1:v%(l%)=1
424 next l%
426 locate p%,q%:print "*";
450 return
([D]iscoversoft) (H-man in [A]CTIVE BASICトップ) (総合索引[t])