This is the most recent copy I have... it's very beaten-up from fiddling around.
#TouhouDanmakufu
#Title[Yuka Animation Task Testing]
#Text[Seeing if I can outsource animation loops to tasks, and use yield in them.]
#Player[FREE]
#ScriptVersion[2]
script_enemy_main {
let ImgBoss = "script\img\ExRumia.png";
let Image = "script\img\testanimationimage.bmp";
let frame = -120;
TAnimation;
@Initialize {
SetLife(2000);
SetTimer(50);
SetScore(1000000);
SetMovePosition02(GetCenterX, GetClipMinY + 120, 120);
CutIn(YOUMU, "Test Sign "\""Test"\", "", 0, 0, 0, 0);
LoadGraphic(ImgBoss);
LoadGraphic(Image);
SetTexture(ImgBoss);
SetGraphicRect(0, 0, 64, 64);
}
@MainLoop {
yield;
DrawGraphic(GetCenterX, GetCenterY);
}
@DrawLoop {
DrawGraphic(GetX, GetY);
}
@Finalize {
DeleteGraphic(ImgBoss);
DeleteGraphic(Image);
}
task TAnimation {
SetTexture(Image);
loop{
SetGraphicRect(0, 0, 100, 100);
yield;
SetGraphicRect(100, 0, 200, 100);
yield;
SetGraphicRect(0, 100, 100, 200);
yield;
SetGraphicRect(100, 100, 200, 200);
yield;
}
}
}
I just have a test image that I use for it. It goes 1, 2, 3, 4 really fast (but I'd be able to get the picture, I think).