|
2017/2/7(Tue) 09:06:01|NO.78160
randomize
difficulty = 1
color 0,0,0
boxf
button goto "はじめる",*begin
pos 0,50
color 255,255,255:mes "アルファベットを使ったシューティングゲームです。\nボタンで小文字を選びます。\nそれぞれの大文字に当てると敵を倒せます。\n移動 十字キー\n小文字選択 左クリック\n攻撃 右クリック"
pos 160,200:button gosub "増やす",*increase
pos 0,200:button gosub "減らす",*decrease
*hata1
redraw 0
color 0,0,0
boxf 80,200,155,225
pos 80,200:color 255,255,255:mes "難易度" + difficulty
await 50
redraw 1
goto *hata1
*begin
dim teki_species,difficulty
for b,0,difficulty
teki_species(b)=rnd(26)
next
player_x=200:player_y=550
screen 0,600,600,,0,0
pos 410,0:button gosub "a",*komoji_a
pos 410,25:button gosub "b",*komoji_b
pos 410,50:button gosub "c",*komoji_c
pos 410,75:button gosub "d",*komoji_d
pos 410,100:button gosub "e",*komoji_e
pos 410,125:button gosub "f",*komoji_f
pos 410,150:button gosub "g",*komoji_g
pos 410,175:button gosub "h",*komoji_h
pos 410,200:button gosub "i",*komoji_i
pos 410,225:button gosub "j",*komoji_j
pos 410,250:button gosub "k",*komoji_k
pos 410,275:button gosub "l",*komoji_l
pos 410,300:button gosub "m",*komoji_m
pos 410,325:button gosub "n",*komoji_n
pos 410,350:button gosub "o",*komoji_o
pos 410,375:button gosub "p",*komoji_p
pos 410,400:button gosub "q",*komoji_q
pos 410,425:button gosub "r",*komoji_r
pos 510,0:button gosub "s",*komoji_s
pos 510,25:button gosub "t",*komoji_t
pos 510,50:button gosub "u",*komoji_u
pos 510,75:button gosub "v",*komoji_v
pos 510,100:button gosub "w",*komoji_w
pos 510,125:button gosub "x",*komoji_x
pos 510,150:button gosub "y",*komoji_y
pos 510,175:button gosub "z",*komoji_z
//敵をランダム生成
敵縦=5
敵横=5
dim enemy,敵横,敵縦
sdim enemy_alphabet,1,敵横,敵縦
for x,0,敵横
for y,0,敵縦
enemy(x,y)=teki_species(rnd(difficulty))
gosub *alphabet表
next
next
*main
redraw 0
color 0,0,0
boxf
stick key,15+512
if key&&1:player_x-=3
if key&&4:player_x+=3
if bullet_switch = 1:goto *jump
if key&&512{
bullet_switch = 1
bullet_x=player_x
bullet_y=player_y
}
*jump
if bullet_switch = 1{
pos bullet_x-5,bullet_y-5:color 255,255,255:mes ""+alphabet
bullet_y-=5
if bullet_y<0:bullet_switch=0
}
//武器を選ぶ
gosub *choose_alphabet
pos player_x,player_y:color 255,255,255:mes "@"
if player_x<0:player_x=0
if player_x>390:player_x=390
line 400,570,0,570
//敵
gosub *enemy1
;counter++
;if counter = 160:counter =0
;pos 200,200:mes ""+counter
//あたり判定
gosub *hantei
redraw 1
await 50
goto *main
*choose_alphabet
if weapon =-1:alphabet=""
if weapon =0:alphabet="a"
if weapon =1:alphabet="b"
if weapon =2:alphabet="c"
if weapon =3:alphabet="d"
if weapon =4:alphabet="e"
if weapon =5:alphabet="f"
if weapon =6:alphabet="g"
if weapon =7:alphabet="h"
if weapon =8:alphabet="i"
if weapon =9:alphabet="j"
if weapon =10:alphabet="k"
if weapon =11:alphabet="l"
if weapon =12:alphabet="m"
if weapon =13:alphabet="n"
if weapon =14:alphabet="o"
if weapon =15:alphabet="p"
if weapon =16:alphabet="q"
if weapon =17:alphabet="r"
if weapon =18:alphabet="s"
if weapon =19:alphabet="t"
if weapon =20:alphabet="u"
if weapon =21:alphabet="v"
if weapon =22:alphabet="w"
if weapon =23:alphabet="x"
if weapon =24:alphabet="y"
if weapon =25:alphabet="z"
return
*enemy1//25ドットずつ動く
for x,0,敵横
for y,0,敵縦
pos x*25+idou_x,y*25+idou_y:mes enemy_alphabet(x,y)
next
next
if idou_switch=0:idou_x++
if idou_switch=1:idou_x--
if idou_x>=160:idou_switch = 1
if idou_x<=0:idou_switch = 0
if idou_x=0:idou_y+=25
if idou_x=160:idou_y+=25
if idou_y==25*19 : goto *gameover
return
*alphabet表
if enemy(x,y)=0:enemy_alphabet(x,y)="A"
if enemy(x,y)=1:enemy_alphabet(x,y)="B"
if enemy(x,y)=2:enemy_alphabet(x,y)="C"
if enemy(x,y)=3:enemy_alphabet(x,y)="D"
if enemy(x,y)=4:enemy_alphabet(x,y)="E"
if enemy(x,y)=5:enemy_alphabet(x,y)="F"
if enemy(x,y)=6:enemy_alphabet(x,y)="G"
if enemy(x,y)=7:enemy_alphabet(x,y)="H"
if enemy(x,y)=8:enemy_alphabet(x,y)="I"
if enemy(x,y)=9:enemy_alphabet(x,y)="J"
if enemy(x,y)=10:enemy_alphabet(x,y)="K"
if enemy(x,y)=11:enemy_alphabet(x,y)="L"
if enemy(x,y)=12:enemy_alphabet(x,y)="M"
if enemy(x,y)=13:enemy_alphabet(x,y)="N"
if enemy(x,y)=14:enemy_alphabet(x,y)="O"
if enemy(x,y)=15:enemy_alphabet(x,y)="P"
if enemy(x,y)=16:enemy_alphabet(x,y)="Q"
if enemy(x,y)=17:enemy_alphabet(x,y)="R"
if enemy(x,y)=18:enemy_alphabet(x,y)="S"
if enemy(x,y)=19:enemy_alphabet(x,y)="T"
if enemy(x,y)=20:enemy_alphabet(x,y)="U"
if enemy(x,y)=21:enemy_alphabet(x,y)="V"
if enemy(x,y)=22:enemy_alphabet(x,y)="W"
if enemy(x,y)=23:enemy_alphabet(x,y)="X"
if enemy(x,y)=24:enemy_alphabet(x,y)="Y"
if enemy(x,y)=25:enemy_alphabet(x,y)="Z"
return
*hantei
/*
for x,0,10
for y,0,5
pos x*25+idou_x,y*25+idou_y:mes enemy_alphabet(x,y)
next
next
*/
for x,0,10
for y,0,5
if ((bullet_x>(x*25+idou_x-10))&&(bullet_x<(x*25+idou_x)+30))&&(bullet_y==y*25+idou_y){
if enemy_alphabet(x,y)="A"&&alphabet="a":enemy_alphabet(x,y)="":bullet_switch=0
if enemy_alphabet(x,y)="B"&&alphabet="b":enemy_alphabet(x,y)="":bullet_switch=0
if enemy_alphabet(x,y)="C"&&alphabet="c":enemy_alphabet(x,y)="":bullet_switch=0
if enemy_alphabet(x,y)="D"&&alphabet="d":enemy_alphabet(x,y)="":bullet_switch=0
if enemy_alphabet(x,y)="E"&&alphabet="e":enemy_alphabet(x,y)="":bullet_switch=0
if enemy_alphabet(x,y)="F"&&alphabet="f":enemy_alphabet(x,y)="":bullet_switch=0
if enemy_alphabet(x,y)="G"&&alphabet="g":enemy_alphabet(x,y)="":bullet_switch=0
if enemy_alphabet(x,y)="H"&&alphabet="h":enemy_alphabet(x,y)="":bullet_switch=0
if enemy_alphabet(x,y)="I"&&alphabet="i":enemy_alphabet(x,y)="":bullet_switch=0
if enemy_alphabet(x,y)="J"&&alphabet="j":enemy_alphabet(x,y)="":bullet_switch=0
if enemy_alphabet(x,y)="K"&&alphabet="k":enemy_alphabet(x,y)="":bullet_switch=0
if enemy_alphabet(x,y)="L"&&alphabet="l":enemy_alphabet(x,y)="":bullet_switch=0
if enemy_alphabet(x,y)="M"&&alphabet="m":enemy_alphabet(x,y)="":bullet_switch=0
if enemy_alphabet(x,y)="N"&&alphabet="n":enemy_alphabet(x,y)="":bullet_switch=0
if enemy_alphabet(x,y)="O"&&alphabet="o":enemy_alphabet(x,y)="":bullet_switch=0
if enemy_alphabet(x,y)="P"&&alphabet="p":enemy_alphabet(x,y)="":bullet_switch=0
if enemy_alphabet(x,y)="Q"&&alphabet="q":enemy_alphabet(x,y)="":bullet_switch=0
if enemy_alphabet(x,y)="R"&&alphabet="r":enemy_alphabet(x,y)="":bullet_switch=0
if enemy_alphabet(x,y)="S"&&alphabet="s":enemy_alphabet(x,y)="":bullet_switch=0
if enemy_alphabet(x,y)="T"&&alphabet="t":enemy_alphabet(x,y)="":bullet_switch=0
if enemy_alphabet(x,y)="U"&&alphabet="u":enemy_alphabet(x,y)="":bullet_switch=0
if enemy_alphabet(x,y)="V"&&alphabet="v":enemy_alphabet(x,y)="":bullet_switch=0
if enemy_alphabet(x,y)="W"&&alphabet="w":enemy_alphabet(x,y)="":bullet_switch=0
if enemy_alphabet(x,y)="X"&&alphabet="x":enemy_alphabet(x,y)="":bullet_switch=0
if enemy_alphabet(x,y)="Y"&&alphabet="y":enemy_alphabet(x,y)="":bullet_switch=0
if enemy_alphabet(x,y)="Z"&&alphabet="z":enemy_alphabet(x,y)="":bullet_switch=0
}
next
next
return
*gameover
pos 200,200:color 255,255,255:mes "GAME OVER"
redraw 1
stop
*komoji_a
weapon=0
return
*komoji_b
weapon=1
return
*komoji_c
weapon=2
return
*komoji_d
weapon=3
return
*komoji_e
weapon=4
return
*komoji_f
weapon=5
return
*komoji_g
weapon=6
return
*komoji_h
weapon=7
return
*komoji_i
weapon=8
return
*komoji_j
weapon=9
return
*komoji_k
weapon=10
return
*komoji_l
weapon=11
return
*komoji_m
weapon=12
return
*komoji_n
weapon=13
return
*komoji_o
weapon=14
return
*komoji_p
weapon=15
return
*komoji_q
weapon=16
return
*komoji_r
weapon=17
return
*komoji_s
weapon=18
return
*komoji_t
weapon=19
return
*komoji_u
weapon=20
return
*komoji_v
weapon=21
return
*komoji_w
weapon=22
return
*komoji_x
weapon=23
return
*komoji_y
weapon=24
return
*komoji_z
weapon=25
return
*increase
difficulty++
if difficulty >25:difficulty--
return
*decrease
difficulty--
if difficulty < 1:difficulty++
return
| |