HSP - Hot Soup Processor [14]
■ このスレッドは過去ログ倉庫に格納されています
0798名前は開発中のものです。
2007/04/28(土) 07:22:58ID:WZUrEfmt#module a x,y,vx,vy,anmcnt
#modinit double cx,double cy
x=cx:y=cy:r=atan(mx@-x,my@-y):vx=sin(r)*5:vy=cos(r)*5:anmcnt=0:return
#modfunc amove
if abs(320-x)>330 or abs(240-y)>250{return -1}
anmcnt++:x+vx:y+vy:pos x-16,y-16:gcopy 1,((anmcnt/10)\5)*32,0:return 0
#global
#module b x,y,r,bcnt,anmcnt
#modinit int cx,int cy
x=cx:y=cy:bcnt=0:anmcnt=0:r=0.0:return
#modfunc bmove
if abs(320-x)>330 or abs(240-y)>250{return -1}
bcnt++:if bcnt<200{r=atan(mx@-x,my@-y)}
anmcnt++:x+=sin(r)*5:y+=cos(r)*5:pos x-16,y-16:gcopy 1,((anmcnt/5)\5)*32,32:return 0
#global
#module set type
#modinit int t,int cx,int cy
type=t:if t=0{newmod shot,a,cx,cy}else{newmod shot,b,cx,cy}:return
#modfunc move int no
if type=0{amove shot(no)}else{bmove shot(no)}
if stat=-1 {delmod shot(no)}:return stat
#global
buffer 1:color:boxf
repeat 5:color ,255:siz=5+(cnt)*(cnt<2)+(1-cnt)*(cnt>1):circle 16+cnt*32-siz,16-siz,16+cnt*32+siz,16+siz
color 255::circle 16+cnt*32-siz,16-siz+32,16+cnt*32+siz,16+siz+32:loop::gsel 0
dimtype shotmod,vartype("struct"),32
repeat:redraw 0:color:boxf:title str(max):mx=mousex:my=mousey:gmode 2,32,32:max=0
foreach shotmod:move shotmod(cnt),cnt:if stat=-1 {delmod shotmod(cnt)}:max++:loop
if max<32 and rnd(50)<5{cx=320+200-rnd(400):newmod shotmod,set,(rnd(5)<2),cx,cy}
redraw 1:await 10:loop
モジュール型変数の新しく追加された要素か次に使われる要素が簡単に分かれば配列で簡単に出来るけど・・・(空いてるところを探すか空いたところを記憶してソートするしかない?)
■ このスレッドは過去ログ倉庫に格納されています