Im such a noob....
Please help with this one. I keep getting "Bad Allocation".
#TouhouDanmakufu
#Title[Fantasy Seal Lol not]
#Text[blahblah]
#Player[FREE]
#ScriptVersion[2]
script_enemy_main{
#include_function "lib\SHOT_REPLACE\shot_replace.dnh"
let CSD = GetCurrentScriptDirectory;
let imgBoss = CSD ~ "system\cirno.png";
let cut = CSD ~ "system\cirnocut.png";
let bg = CSD ~ "system\lake.png";
@Initialize{
SetLife(1000);
SetTimer(60);
SetScore(100000);
SetMovePosition01(GetCenterX,GetCenterY,5);
LoadGraphic(imgBoss);
LoadGraphic(cut);
LoadGraphic(bg);
shotinit;
CutIn(YOUMU,"Holy Amulet -Spread-",cut,0,0,300,384);
mainTask;
}
@MainLoop{
SetCollisionA(GetX,GetY,32);
SetCollisionB(GetX,GetY,16);
yield;
}
@DrawLoop{
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{
DeleteGraphic(imgBoss);
DeleteGraphic(cut);
DeleteGraphic(bg);
}
task mainTask{
wait(120);
yield;
fire;
movement;
}
task movement{
loop{
SetMovePosition01(GetCenterX-100,120,5);
wait(120);
SetMovePosition01(GetCenterX+100,120,5);
wait(120);
yield;
}
}
task fire{
let x = 0;
let dir = 0;
let dira = 0;
loop{
while(x<36){
CreateShotA(1,GetEnemyX+75*cos(dir),GetEnemyY+75*sin(dir),30);
SetShotDataA(1,0,0,dir,0,0,0,RED01);
SetShotDataA(1,60,2,dir,0.5,0,2,YELLOW01);
FireShot(1);
CreateShotA(2,GetEnemyX+75*sin(dir),GetEnemyY+75*cos(dir),30);
SetShotDataA(2,0,0,dira,0,0,0,YELLOW01);
SetShotDataA(2,60,2,dira,-0.5,0,2,RED01);
FireShot(2);
}
dir+=360/36;
dira-=360/36;
x++;
x = 0;
dir = 0;
dira = 0;
wait(60);
yield;
}
}
function wait(w){
loop(w){yield;}
}
}