s=cmdline:peek a,s,1 if a='p' : goto *sspre if a='s' : goto *ssproc if a='c' : goto *sscfg if a=0 : goto *sscfg dialog "Unknown switch ["+cmdline+"]" end *sscfg width 440,260 : title "ぐらで〜しょん・設定" : color 200,255,0 : boxf 0,0,440,260 exist "grada.ini" if strsize=-1 {bcopy "grada.scr","grada.ini" str c0 : c0="2 1 1 3 5 10" bsave "grada.ini",c0,52} str c1 : str c2 : str c3 : str c4 : str c5 : str c6 bload "grada.ini",c6 bload "grada.ini",c5,,10 bload "grada.ini",c4,,20 bload "grada.ini",c3,,30 bload "grada.ini",c2,,40 bload "grada.ini",c1,,50 int c1 : int c2 : int c3 : int c4 : int c5 : int c6 gsel 0,2 font "MS ゴシック",13 : objmode 1 color 255,0,255 : line 0,10,440,10 : line 0,250,440,250 : line 10,0,10,260 : line 428,0,428,260 color 0,0,0 pos 40,20 : input c01,25,20,2 : objprm 0,c1 pos 95,22 : mes "☆の大きさ (1〜30)" pos 43,50 : input c02,18,20,1 : objprm 1,c2 pos 95,52 : mes "一度に動く最長距離 (1〜9)" pos 43,80 : input c03,18,20,1 : objprm 2,c3 pos 95,82 : mes "残像の長さ (1〜9)" pos 43,110 : input c04,18,20,1 : objprm 3,c4 pos 95,112 : mes "動くスピード (1〜9)" pos 43,140 : input c05,18,20,1 : objprm 4,c5 pos 95,142 : mes "一度止まってからまた動き出すまでの待ち時間 (1〜9)" pos 20,170 if c6=0 : combox c06,100,"消す\n残す\n併用" if c6=1 : combox c06,100,"残す\n併用\n消す" if c6=2 : combox c06,100,"併用\n消す\n残す" pos 95,172 : mes "止まったときに、姿を残すか消すか、その併用か" font "MS 明朝",110 pos 120,208 : button "変更する",*over pos 250,208 : button "やっぱやめる",*cancel stop *sspre cls 4 color 50,250,100 : pos 40,30 : font "MS ゴシック",90 : mes "☆" color 50,200,100 : pos 35,25 : font "MS ゴシック",90 : mes "☆" color 50,150,100 : pos 30,20 : font "MS ゴシック",90 : mes "☆" color 50,100,100 : pos 25,15 : font "MS ゴシック",90 : mes "☆" color 50,50,100 : pos 20,10 : font "MS ゴシック",90 : mes "☆" stop *ssproc bgscr 2,dispx,dispy,0,0,0 ax=dispx : ay=dispy exist "grada.ini" ; 同じフォルダ内にiniファイルがあるかどうか調べる if strsize=-1 {bcopy "grada2.as","grada.ini" ; なかったらiniファイルを作ってデフォルトのデータを書き込む str c0 : c0="2 1 1 3 5 10" bsave "grada.ini",c0,52} str c1 : str c2 : str c3 : str c4 : str c5 : str c6 bload "grada.ini",c6 bload "grada.ini",c5,,10 bload "grada.ini",c4,,20 bload "grada.ini",c3,,30 bload "grada.ini",c2,,40 bload "grada.ini",c1,,50 int c1 : int c2 : int c3 : int c4 : int c5 : int c6 c1=c1*10 c2=c2*2 c3=c3*3 c4=(10-c4)*10 c5=c5*10 cls 4 : font "MS ゴシック",c1 x=ax/2-c1 : y=ay/2-c1 *main if ((x+c1)<0)|((x-c1)>ax)|((y+c1)<0)|((y-c1)>ay) {cls 4 : x=ax/2-c1 : y=ay/2-c1} ;画面外に出たら中央に戻す randomize rnd direction,8 rnd move,10 rnd ending,2 rnd color1,255 rnd color2,255 if c6!2 : ending=c6 ; 動き始め。残像がだんだん伸びていく x1=x : y1=y : count=1 : count2=1 repeat c3 redraw 2 if direction=0 : y-=10 if direction=1 {x+=10 : y-=10} if direction=2 : x+=10 if direction=3 {x+=10 : y+=10} if direction=4 : y+=10 if direction=5 {x-=10 : y+=10} if direction=6 : x-=10 if direction=7 {x-=10 : y-=10} repeat count if direction=0 : pos x,y+(count2*10) if direction=1 : pos x-(count2*10),y+(count2*10) if direction=2 : pos x-(count2*10),y if direction=3 : pos x-(count2*10),y-(count2*10) if direction=4 : pos x,y-(count2*10) if direction=5 : pos x+(count2*10),y-(count2*10) if direction=6 : pos x+(count2*10),y if direction=7 : pos x+(count2*10),y+(count2*10) color color1,count2*(250/c3),color2 mes "☆" count2-- : loop redraw 1 count++ : count2=count : await c4 : loop ; メイン動作 if direction=0 : y=y1-10 if direction=1 {x=x1+10 : y=y1-10} if direction=2 : x=x1+10 if direction=3 {x=x1+10 : y=y1+10} if direction=4 : y=y1+10 if direction=5 {x=x1-10 : y=y1+10} if direction=6 : x=x1-10 if direction=7 {x=x1-10 : y=y1-10} count=0 repeat move : redraw 2 if direction=0 : pos x,y+10 if direction=1 : pos x-10,y+10 if direction=2 : pos x-10,y if direction=3 : pos x-10,y-10 if direction=4 : pos x,y-10 if direction=5 : pos x+10,y-10 if direction=6 : pos x+10,y if direction=7 : pos x+10,y+10 color 0,0,0 : mes "☆" repeat c3 if direction=0 : pos x,y-(count*10) if direction=1 : pos x+(count*10),y-(count*10) if direction=2 : pos x+(count*10),y if direction=3 : pos x+(count*10),y+(count*10) if direction=4 : pos x,y+(count*10) if direction=5 : pos x-(count*10),y+(count*10) if direction=6 : pos x-(count*10),y if direction=7 : pos x-(count*10),y-(count*10) color color1,count2*(250/c3),color2 if count2=0 : color 0,count2*(250/c3),0 mes "☆" count++ : loop redraw 1 : count=0 if direction=0 : y-=10 if direction=1 {x+=10 : y-=10} if direction=2 : x+=10 if direction=3 {x+=10 : y+=10} if direction=4 : y+=10 if direction=5 {x-=10 : y+=10} if direction=6 : x-=10 if direction=7 {x-=10 : y-=10} await c4 : loop if ending=0 : goto *disappear ; 動き終わり。先頭が動かなくなり、残像が少なくなっていく if direction=0 : y+=10 if direction=1 {x-=10 : y+=10} if direction=2 : x-=10 if direction=3 {x-=10 : y-=10} if direction=4 : y-=10 if direction=5 {x+=10 : y-=10} if direction=6 : x+=10 if direction=7 {x+=10 : y+=10} count=(c3-1) : count2=0 repeat (c3-1) redraw 2 repeat count if direction=0 : pos x,y-(count2*10) if direction=1 : pos x+(count2*10),y-(count2*10) if direction=2 : pos x+(count2*10),y if direction=3 : pos x+(count2*10),y+(count2*10) if direction=4 : pos x,y+(count2*10) if direction=5 : pos x-(count2*10),y+(count2*10) if direction=6 : pos x-(count2*10),y if direction=7 : pos x-(count2*10),y-(count2*10) color color1,count2*(250/c3),color2 if count2=0 : color 0,count2*(250/c3),0 mes "☆" count2++ : loop if direction=0 : pos x,y-(count2*10) if direction=1 : pos x+(count2*10),y-(count2*10) if direction=2 : pos x+(count2*10),y if direction=3 : pos x+(count2*10),y+(count2*10) if direction=4 : pos x,y+(count2*10) if direction=5 : pos x-(count2*10),y+(count2*10) if direction=6 : pos x-(count2*10),y if direction=7 : pos x-(count2*10),y-(count2*10) color color1,255,color2 : mes "☆" if direction=0 : y-=10 if direction=1 {x+=10 : y-=10} if direction=2 : x+=10 if direction=3 {x+=10 : y+=10} if direction=4 : y+=10 if direction=5 {x-=10 : y+=10} if direction=6 : x-=10 if direction=7 {x-=10 : y-=10} redraw 1 count-- : count2=0 : await c4 : loop wait c5 goto *main *disappear if direction=0 : y+=10 if direction=1 {x-=10 : y+=10} if direction=2 : x-=10 if direction=3 {x-=10 : y-=10} if direction=4 : y-=10 if direction=5 {x+=10 : y-=10} if direction=6 : x+=10 if direction=7 {x+=10 : y+=10} count=c3 : count2=0 repeat c3 : redraw 2 : repeat count if direction=0 : pos x,y-(count2*10) if direction=1 : pos x+(count2*10),y-(count2*10) if direction=2 : pos x+(count2*10),y if direction=3 : pos x+(count2*10),y+(count2*10) if direction=4 : pos x,y+(count2*10) if direction=5 : pos x-(count2*10),y+(count2*10) if direction=6 : pos x-(count2*10),y if direction=7 : pos x-(count2*10),y-(count2*10) color color1,count2*(250/c3),color2 if count2=0 : color 0,count2*(250/c3),0 mes "☆" count2++ : loop if direction=0 : y-=10 if direction=1 {x+=10 : y-=10} if direction=2 : x+=10 if direction=3 {x+=10 : y+=10} if direction=4 : y+=10 if direction=5 {x-=10 : y+=10} if direction=6 : x-=10 if direction=7 {x-=10 : y-=10} redraw 1 count-- : count2=0 : await c4 : loop wait c5 goto *main *over er=0 if (c01<1)|(c01>30) : er+=1 if c02<1 : er+=2 if c03<1 : er+=4 if c04<1 : er+=8 if c05<1 : er+=16 if er!0 : goto *error c06=(c6+c06)\3 str c01 : str c02 : str c03 : str c04 : str c05 : str c06 c0=c06+" "+c05+" "+c04+" "+c03+" "+c02+" "+c01 bsave "grada.ini",c0,52 end *error if er=1 : dialog "☆の大きさがおかしいよ",1 if er=2 : dialog "最長距離がおかしいよ",1 if (er=3)|(er=5)|(er=6)|(er=9)|(er=10)|(er=12)|(er=17)|(er=18)|(er=20)|(er=24) : dialog "2ヶ所数値がおかしいよ",1 if er=4 : dialog "残像の長さがおかしいよ",1 if (er=7)|(er=11)|(er=13)|(er=14)|(er=19)|(er=21)|(er=22)|(er=25)|(er=26)|(er=28) : dialog "3ヶ所も数値がおかしいよ",1 if er=8 : dialog "動くスピードがおかしいよ",1 if (er=15)|(er=23)|(er=27)|(er=29)|(er=30) : dialog "4ヶ所も数値がおかしいよ!",1 if er=16 : dialog "待ち時間がおかしいよ",1 if er=31 : dialog "もう〜、5ヶ所も変だよ!" goto *sscfg stop *cancel end