Tiny Basic for Windowsで簡単な射的ゲームを作りました!
主人公は左から右へ自動的に動いて、Spaceキーで撃てます!
2周全部的を撃ちぬいたらクリアです。逆に、一つでも残ったらアウト。
弾は8発です。二週目に入ると補充されます。
ビジーウェイトを使ってるからパソコンによって速さが違うかもしれないから、
調整してみてください。
以下が作ったゲームの本体です↓(これでなんか起こっても責任は負いかねます)
Randomize
gm=0
主人公は左から右へ自動的に動いて、Spaceキーで撃てます!
2周全部的を撃ちぬいたらクリアです。逆に、一つでも残ったらアウト。
弾は8発です。二週目に入ると補充されます。
ビジーウェイトを使ってるからパソコンによって速さが違うかもしれないから、
調整してみてください。
以下が作ったゲームの本体です↓(これでなんか起こっても責任は負いかねます)
Randomize
gm=0
DIM matox(6)
DIM matoy(6)
public bstm
GBackColor=0
GScreen(480,240)
010 GLocate(100,50)
gm=0
GForeColor=15
GFontSize=30
GPrint"全部ぶちぬけ!"
GLocate(170,120)
GFontSize=12
GPrint"Spaceキー押せ"
for i=0 to 2 step 0
if inkey$=" " then
i=3
cls 2
endif
next i
'タイトル終了
020 sc=0
print"GAME START"
x=20
y=190
shot=8
DIM matoy(6)
public bstm
GBackColor=0
GScreen(480,240)
010 GLocate(100,50)
gm=0
GForeColor=15
GFontSize=30
GPrint"全部ぶちぬけ!"
GLocate(170,120)
GFontSize=12
GPrint"Spaceキー押せ"
for i=0 to 2 step 0
if inkey$=" " then
i=3
cls 2
endif
next i
'タイトル終了
020 sc=0
print"GAME START"
x=20
y=190
shot=8
if gm=2 then
GLocate(170,110)
GFontSize=12
GPrint"げーむくりあ!"
gm=0
for i=0 to 2 step 0
if inkey$=" " then
i=3
cls 2
endif
next i
goto 010
endif
cls 2
for i=0 to 6'的を設置
matox(i)=int(rnd(1)*400)+60
matoy(i)=int(rnd(1)*100)
GLocate(matox(i),matoy(i))
GPrint"◎"
next i
GLocate(170,110)
GFontSize=12
GPrint"げーむくりあ!"
gm=0
for i=0 to 2 step 0
if inkey$=" " then
i=3
cls 2
endif
next i
goto 010
endif
cls 2
for i=0 to 6'的を設置
matox(i)=int(rnd(1)*400)+60
matoy(i)=int(rnd(1)*100)
GLocate(matox(i),matoy(i))
GPrint"◎"
next i
for g=0 to 5 step 0
x=x+1
call bswt
GLocate(x,y)
GPrint"凸"
line(x,y)-(x-5,y+16),0,bf
if inkey$=" " then
if shot<>0 then
shot=shot-1
line(x+6,y)-(x+6,0)
for i=0 to 6'衝突判定
if matox(i)<x+6 and matox(i)+14>x+6 then
sc=sc+1
print 7-sc
if sc=7 then
bstm=100000
call bswt
GLocate(180,120)
bstm=10000
gm=gm+1
goto 020
end if
matox(i)=0
endif
next i
bstm=200000
call bswt
cls 2
bstm=10000
for i=0 to 6
if matox(i)<>0 then
GLocate(matox(i),matoy(i))
GPrint"◎"
endif
next i
endif
end if
GLocate(8,3)
GPrint "残り弾数"
GLocate(0,19)
GPrint shot
if sc<>7 and 480<x then
GLocate(170,110)
GFontSize=12
GPrint"げーむおーばー"
for i=0 to 2 step 0
if inkey$=" " then
i=3
cls 2
endif
next i
bstm=10000
goto 010
endif
next g
x=x+1
call bswt
GLocate(x,y)
GPrint"凸"
line(x,y)-(x-5,y+16),0,bf
if inkey$=" " then
if shot<>0 then
shot=shot-1
line(x+6,y)-(x+6,0)
for i=0 to 6'衝突判定
if matox(i)<x+6 and matox(i)+14>x+6 then
sc=sc+1
print 7-sc
if sc=7 then
bstm=100000
call bswt
GLocate(180,120)
bstm=10000
gm=gm+1
goto 020
end if
matox(i)=0
endif
next i
bstm=200000
call bswt
cls 2
bstm=10000
for i=0 to 6
if matox(i)<>0 then
GLocate(matox(i),matoy(i))
GPrint"◎"
endif
next i
endif
end if
GLocate(8,3)
GPrint "残り弾数"
GLocate(0,19)
GPrint shot
if sc<>7 and 480<x then
GLocate(170,110)
GFontSize=12
GPrint"げーむおーばー"
for i=0 to 2 step 0
if inkey$=" " then
i=3
cls 2
endif
next i
bstm=10000
goto 010
endif
next g
sub bswt
for bs=0 to bstm
next bs
end sub
for bs=0 to bstm
next bs
end sub
PR
プロフィール
HN:
Xenon
性別:
非公開
最新記事
P R