#TouhouDanmakufu
#Title[Hell "- Edge of the fire blade -"]
#Text[Not everyone can see...]
#Player[FREE]
#ScriptVersion[2]
#BGM[bgm\Medicine.mp3]
script_enemy_main{
let CSD = GetCurrentScriptDirectory;
let imgBoss = CSD ~ "system\Kora.png";
let cut = CSD ~ "system\Koracut.png";
let bg = CSD ~ "system\Temple.png";
@Initialize{
SetLife(5000);
SetTimer(100);
SetScore(100000);
SetMovePosition01(GetCenterX,GetCenterY,5);
LoadGraphic(imgBoss);
LoadGraphic(cut);
LoadGraphic(bg);
CutIn(YOUMU,"Hell - Edge of the fire blade -",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(225);
SetGraphicRect(0,0,110,110);
SetGraphicScale(0.5,0.5);
SetGraphicAngle(0,0,0);
DrawGraphic(GetX,GetY);
}
@BackGround{
SetTexture(bg);
SetRenderState(ALPHA);
SetAlpha(225);
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);
}
task mainTask{
wait(120);
yield;
fire;
}
task fire{
//loop{
bullet(GetEnemyX,GetEnemyY,0.5,270,ORANGE32,0);
wait(240);
yield;
//}
}
task bullet(x,y,v,a,g,d){
let counter=0;
let obj=Obj_Create(OBJ_SHOT);
Obj_SetPosition(obj,x,y);
Obj_SetAngle(obj,a);
Obj_SetSpeed(obj,0.9);
ObjShot_SetGraphic(obj,ORANGE32);
ObjShot_SetDelay(obj,20);
while(!Obj_BeDeleted(obj)){
if(Obj_GetY(obj) > GetClipMaxY) {
Obj_SetAngle(obj,-dir);
}
counter++;
if(counter==140){Obj_SetAngle(obj, atan2(GetPlayerY-Obj_GetY(obj),GetPlayerX-Obj_GetX(obj)));}
if(counter==180){Obj_SetSpeed(obj,2);}
if(counter==260&&d<=5){
bullet(Obj_GetX(obj),Obj_GetY(obj),1,Obj_GetAngle(obj)+35+180,ORANGE32,d+1);
bullet(Obj_GetX(obj),Obj_GetY(obj),2,Obj_GetAngle(obj)+0+180,ORANGE32,d+1);
bullet(Obj_GetX(obj),Obj_GetY(obj),3,Obj_GetAngle(obj)-35+180,ORANGE32,d+1);
}
//if(counter==300){d = 0;}
yield;
}
}
// wait function
function wait(w){
loop(w){yield;}
}
}
Theres apparently a problem with my -dir command...it wont work...do i have to define direction? :V
EDIT: Also, do i have to add a loop to make it loop?