#TouhouDanmakufu
#Title[unknown]
#BGM[.\bgm.mp3]
#Player[FREE]
#ScriptVersion[2]
script_enemy_main
{
let CSD = GetCurrentScriptDirectory;
let imgBoss = CSD ~ "system\cirno.png";
let cut = CSD ~ "system\cirnocut.png";
let bg = CSD ~ "system\lake.png";
@Initialize {
SetLife(3000);
SetTimer(30);
SetScore(50000);
SetMovePosition01(GetCenterX,GetCenterY,10);
LoadGraphic(imgBoss);
LoadGraphic(cut);
LoadGraphic(bg);
CutIn(YOUMU,"Powder storm",cut,0,0,300,384);
mainTask;
}
@MainLoop{
SetCollisionA(GetX,GetY,32);
SetCollisionB(GetX,GetY,16);
yield;
}
@DrawLoop{
// data for the boss
SetTexture(imgBoss);
SetRenderState(ALPHA);
SetAlpha(255);
SetGraphicRect(0,0,110,110);
SetGraphicScale(0.7,0.7);
SetGraphicAngle(0,0,0);
DrawGraphic(GetX,GetY);
}
@BackGround{
SetTexture(bg);
SetRenderState(ALPHA);
SetAlpha(255);
SetGraphicRect(0,0,512,512);
SetGraphicScale(1,1);
SetGraphicAngle(0,0,0);
DrawGraphic(GetCenterX,GetCenterY);
}
@Finalize{
// delete the image from memory
DeleteGraphic(imgBoss);
DeleteGraphic(cut);
DeleteGraphic(bg);
}
// main task. activates stuff.
task mainTask{
yield;
fire;
}
task fire{
let x = 0;
let dir = 180;
loop{
while(x<8){
superbullet(GetEnemyX,GetEnemyY,3,dir,AQUA01,0);
dir+=180/8;
x++;
}
x = 0;
dir=180;
wait(90);
yield;
}
}
// object bullet task
task superbullet(x,y,v,dir,graphic,delay){
let obj = Obj_Create(OBJ_SHOT);
Obj_SetPosition(obj,x,y);
Obj_SetSpeed(obj,v);
Obj_SetAngle(obj,dir);
ObjShot_SetGraphic(obj,graphic);
ObjShot_SetDelay(obj,0);
ObjShot_SetBombResist(obj,true);
while(Obj_BeDeleted(obj)==false) {
Obj_SetSpeed(obj,0); // stop the bullet
wait(30); //wait half second
Obj_SetAngle(obj, atan2(GetPlayerY - Obj_GetY(obj), GetPlayerX - obj_GetX9obj))); // Homes
ObjShot_SetGraphic(obj,Aqua23); // changes graphic
Obj_SetSpeed(obj,4); // Fires bullets
yield;
}
}
}
}
It says there's something wrong with the wait function, but I can't find anything wrong? Any ideas.