#“Œ•ϋ’e–‹•— #Title[―•„’The Flowing Stars£] #Text[’e–‹•—ƒRƒ“ƒeƒXƒg—p] #ScriptVersion[2] script_enemy_main { let name = "―•„’The Flowing Stars£"; let imgBoss = "script\img\ExRumia.png"; let xIni = GetCenterX; let yIni = GetClipMinY + 128; @Initialize { CutIn(YOUMU, name, "", 0, 0, 0, 0); SetLife(2000); SetTimer(60); SetScore(200000); SetInvincibility(120); LoadGraphic(imgBoss); SetTexture(imgBoss); setGraphicStop; TMain; } @MainLoop { SetCollisionA(GetX, GetY, 32); SetCollisionB(GetX, GetY, 16); yield; } @DrawLoop { DrawGraphic(GetX, GetY); } @Finalize { DeleteGraphic(imgBoss); } task TMain { standBy; shotStar; loop { move; wait(60*2); } } sub standBy { let wIni = 120; SetMovePosition02(xIni, yIni, wIni); setGraphicMove; SetInvincibility(wIni); wait(wIni); setGraphicPose; } task shotStar{ let pai=3.1415; loop{ let r=rand_int(15,20); let sx=rand_int(GetClipMinX+r,GetClipMaxX-r); let sy=rand_int(GetClipMinY+r,128-r); let n=rand_int(5,12); let m=rand_int(2+(|n/10|),(|n/2+0.99|)-1); let vangle=90+rand_int(-15,15); let dangle=20; let v=dangle*r/180*pai; Star(sx,sy,n,m,r,v,vangle,dangle); wait(3); } } task Star(sx,sy,n,m,r,v,vangle,dangle) { let sangle=-90; let angle2=180*(n/m-2)/(n/m); loop(n){ LO(sx,sy,r,v,vangle,dangle,sangle,angle2); sangle+=360/n; } } task LO(sx,sy,r,v,vangle,dangle,sangle,angle2){ let obj = Obj_Create(OBJ_LASER); ObjLaser_SetWidth(obj, 2); ObjLaser_SetSource(obj, false); ObjShot_SetGraphic(obj, YELLOW01); ObjLaser_SetLength(obj, r * cos(angle2/2) * 2); let angle=sangle; let cx=sx; let cy=sy; while(!Obj_BeDeleted(obj)){ let x=cx+r*cos(angle); let y=cy+r*sin(angle); Obj_SetX(obj, x); Obj_SetY(obj, y); Obj_SetAngle(obj, (180+angle)-angle2/2); cx+=v*cos(vangle); cy+=v*sin(vangle); angle+=dangle; if(angle>=360){angle-=360;} yield; } } sub move { let wMove = 40; moveToPlayer(rand(40, 80), rand(-40, 40), wMove, GetClipMinX + 32, GetClipMinY + 32, GetClipMaxX - 32, GetClipMinY + 128); setGraphicMove; wait(wMove); setGraphicStop; } function moveToPlayer(xMove, yAdd, frame, left, top, right, bottom) { let x; let y; if(GetPlayerX < GetX) { x = GetX - xMove; if(x < left) { x = GetX + xMove; } } else { x = GetX + xMove; if(right < x) { x = GetX - xMove; } } y = GetY + yAdd; if(y < top) { y = top; } else if(bottom < y) { y = bottom; } SetMovePosition02(x, y, frame); } sub setGraphicStop { SetGraphicRect( 0, 0, 64, 64); } sub setGraphicPose { SetGraphicRect( 64, 0, 128, 64); } sub setGraphicLeft { SetGraphicRect(128, 0, 192, 64); } sub setGraphicRight { SetGraphicRect(192, 0, 256, 64); } sub setGraphicMove { if(GetSpeedX < 0) { setGraphicLeft; } else { setGraphicRight; } } function wait(w) { loop(w) { yield; } } }