;"シューティングゲーム(Ver.1.0) By Takumitsu" title "Shooting Game" ; 2001/3/4(初版) ;変数 ; @xmax x座標最大値 ; @ymax y座標最大値 ; @mx 自機x移動数 ; @my 自機y移動数 ; @xstep 自機x移動係数 ; @ystep 自機y移動係数 ; @key 入力キー ; @treq 弾発射キーフラグ ; @tf 弾フラグ ; @score 得点 ; @ct ループカウンター ; @tx 弾x ; @ty 弾y ; @ef 敵フラグ ; @ex 敵x移動数 ; @high ハイスコアー ; @wait 待ち時間 screen 0,200,360,0 randomize sndload "laser.wav",1,0 sndload "ene.wav",2,0 @xmax=11:@ymax=19 @mx=7:@my=7 @xstep=16:@ystep=16 font "",16,0 @tf=0:@score=0 *mainlp redraw 0 color 0,0,0:boxf 0,0,winx,winy-40 if (@ct & 3)=0:gosub *enemove gosub *hitcheck gosub *tamamove gosub *hitcheck gosub *eneput gosub *tamaput gosub *memove gosub *newtama gosub *newene redraw 1 @ct=(@ct+1)&255 await @wait goto *mainlp *memove ;key input stick @key,15,1 if @key & 1:@mx-- if @key & 2:@my-- if @key & 4:@mx++ if @key & 8:@my++ if @key & 16:@treq=1 ;max min check if @mx<0:@mx=0 if @mx>@xmax:@mx=@xmax if @my<0:@my=0 if @my>@ymax:@my=@ymax color 0,128,255 pos @mx*@xstep,@my*@ystep mes "A" return *newtama if @tf!0:return if @treq!1:return @tx=@mx:@ty=@my:@tf=1:@treq=0:snd 1 return *tamamove if @tf=0:return @ty-- return *tamaput if @tf=0:return if @ty<0:@tf=0:return color 255,255,255 pos @tx*@xstep,@ty*@ystep mes "|" return *newene if @ef!0:return rnd @ex @xmax @ey=0:@dx=5:@ef=1 gosub *score return *enemove if @ef=0:return @ey++ return *eneput if @ef=0:return if @ey > @ymax:@ef=0:@score=0:return color 0,128,0 pos @ex*@xstep,@ey*@ystep mes "W" return *hitcheck if @tf=0:return if (@ex=@tx)&(@ey=@ty) { @tf=0:@ef=0:@score ++ color 128,0,0 pos @ex*@xstep,@ey*@ystep mes "W" snd 2 gosub *score } return *score color 0,255,0 boxf 0,winy-40,winx,winy font "",16 if @score>@high:@high=@high+1 color 255,0,255 pos 5,winy-35 mes "Score" pos 45,winy-35 mes @score color 255,0,0 pos 80,winy-35 mes "Hight Score" pos 160,winy-35 mes @high @wait=100-(@score/1) return