I'm having a huge issue where my script looks to be correct, but when executed, causes Danmakufu to freeze. Whether I'm causing an overflow or not, it's really frustrating. I'm trying to make an enemy script where it shoots a circle shot similar to the spinners in Hina's stage in MoF, and only the movement works...
//stage 1 enemy 2. Stops at a point, shoots a circle shot, then retreats.
script_enemy_main{
let get = GetCurrentScriptDirectory;
let EnemyImage = get ~ ".\img\dummy.png";
let pow2 = get ~ ".\se\pow2.wav";
@Initialize {
LoadSE(pow2);
LoadGraphic(EnemyImage);
SetLife(150);
SetScore(1500);
SetInvincibility(30);
SetEnemyMarker(false);
SetDurableSpellCard;
mainTask;
}
@MainLoop {
SetCollisionA(GetX,GetY,16);
SetCollisionB(GetX,GetY,8);
yield;
}
@DrawLoop {
SetTexture(EnemyImage);
SetRenderState(ALPHA);
SetAlpha(255);
SetGraphicRect(0,0,8,8);
SetGraphicScale(1,1);
SetGraphicAngle(0,0,0);
DrawGraphic(GetX, GetY);
}
@Finalize {
}
task mainTask{
move;
wait(60);
fire;
wait(90);
exit;
yield;
}
task move{
if(GetX>GetCenterX){
SetMovePosition03(GetCenterX+100,GetCenterY-90,10,4);
}
else{
SetMovePosition03(GetCenterX-100,GetCenterY-90,10,4);
}
yield;
}
task exit{
SetMovePosition03(GetX(),GetCenterY-500,12,4);
if(GetY<GetClipMinY){
VanishEnemy;
}
yield;
}
task fire{
let angle=0;
let x=0;
loop{
PlaySE(pow2);
while(x<15){
CreateShot02(GetX(),GetY(),8,angle,-4,0.5,WHITE11,1);
angle+=360/15;
x++;
}
}
yield;
}
function wait(w){
loop(w){yield;}
}
}