;ffire.as 花火のように、点を円形に広がらせる #include "hspext.as" #define NUM 32 interval=1 dim x,NUM: dim y,NUM ;現在位置 dim dx,NUM: dim dy,NUM ;速度(固定小数のcos,sin) emath 10: one=1024 ;固定小数の1.00 i=0: deg=0 ;角度(度の100倍) repeat NUM x.cnt=320*one: y.cnt=240*one: angle=deg*one/36000 emcos dx.cnt,angle;: dx.cnt=-c ;emcosのバグ回避 emsin dy.cnt,angle: deg+=1125 loop: hankei=100 ;花火の半径 step=2 ;広がる速度 cls 4: button "花火",*l_fire stop *l_fire color 255,255,0: pset x.0/one,y.0/one: i=0 repeat hankei/step: await interval repeat NUM color 0,0,0: pset x.cnt/one,y.cnt/one x.cnt+=dx.cnt*step: y.cnt+=dy.cnt*step color 255,255,0: pset x.cnt/one,y.cnt/one loop loop repeat NUM color 0,0,0: pset x.cnt/one,y.cnt/one: x.cnt=320*one: y.cnt=240*one loop stop