Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #TouhouDanmakufu
- #Title[test"]
- #Text[Cirno's Spell Card]
- #BGM[script\cirno\Beloved Tomboyish Daughter.mp3]
- #PlayLevel[Lunatic]
- #Player[FREE]
- #ScriptVersion[2]
- script_enemy_main {
- let CSD = GetCurrentScriptDirectory;
- let boss = CSD ~ "anm.png";
- let cut = CSD ~ "cirnocutin.png";
- let bg = CSD ~ "ice.png";
- let lay = CSD ~ "snow.png";
- let slide = 0;
- let sfx1 = CSD ~ "sfx/ShotA.wav";
- let f = 0;
- let f2 = 0;
- @Initialize {
- SetLife(2000);
- SetTimer(60);
- SetScore(48000000);
- SetMovePosition01(GetCenterX, GetClipMinY + 120, 5);
- SetShotAutoDeleteClip(10000,10000,10000,10000);
- LoadGraphic(boss);
- LoadGraphic(cut);
- LoadGraphic(bg);
- LoadGraphic(lay);
- LoadSE(sfx1);
- CutIn(YOUMU, "Test Sign"\""My Problem With Random Movement"\",cut,0,0,566,775);
- mainTask;
- }
- @MainLoop {
- SetCollisionA(GetX,GetY,24);
- SetCollisionB(GetX,GetY,16);
- yield;
- }
- @DrawLoop {
- SetTexture(boss);
- SetRenderState(ALPHA);
- SetAlpha(255);
- SetGraphicScale(1,1);
- SetGraphicAngle(0,0,0);
- if(int(GetSpeedX())==0){
- if(f<10){ SetGraphicRect(0,0,64,64); }
- if(f>=10 && f<20){ SetGraphicRect(64,0,128,64); }
- if(f>=20 && f<30){ SetGraphicRect(128,0,192,64); }
- if(f>=30 && f<40){ SetGraphicRect(192,0,256,64); }
- f2=0;
- }
- if(GetSpeedX()>0){
- if(f2<5){ SetGraphicRect(0,64,64,128); }
- if(f2>=5 && f2<10){ SetGraphicRect(64,64,128,128); }
- if(f2>=10 && f2<15){ SetGraphicRect(128,64,192,128); }
- if(f2>=15){ SetGraphicRect(192,64,256,128); }
- f2++;
- }
- if(GetSpeedX()<0){
- SetGraphicAngle(180,0,0);
- if(f2<5){ SetGraphicRect(0,64,64,128); }
- if(f2>=5 && f2<10){ SetGraphicRect(64,64,128,128); }
- if(f2>=10 && f2<15){ SetGraphicRect(128,64,192,128); }
- if(f2>=15){ SetGraphicRect(192,64,256,128); }
- f2++;
- }
- DrawGraphic(GetX,GetY);
- f++;
- if(f==40){f=0;}
- }
- @BackGround {
- SetTexture(bg);
- SetRenderState(ALPHA);
- SetAlpha(255);
- SetGraphicRect(0,0,1600,1118);
- SetGraphicScale(1,1);
- SetGraphicAngle(0,0,0);
- DrawGraphic(GetCenterX,GetCenterY);
- SetTexture(lay);
- SetRenderState(ADD);
- SetGraphicRect(0,0,20000,20000);
- SetGraphicScale(1,1);
- SetGraphicAngle(0,0,0);
- DrawGraphic(GetCenterX+slide,GetCenterY+slide);
- slide+=2;
- }
- @Finalize {
- DeleteGraphic(boss);
- DeleteGraphic(bg);
- DeleteGraphic(cut);
- }
- task mainTask{
- wait(60);
- yield;
- fire;
- move;
- }
- task move{
- loop{
- SetMovePositionRandom01(13,13,5,120,120,120,120);
- wait(30);
- yield;
- }
- }
- task fire{
- let x = 0;
- let dir = 0;
- wait(30);
- loop{
- PlaySE(sfx1);
- while(x<36){
- CreateShotA(1,GetEnemyX,GetEnemyY,1);
- SetShotDataA(1,0,1,dir,2,-0.5,8,AQUA02);
- FireShot(1);
- dir+=360/36;
- x++;
- }
- x = 0;
- dir = 0;
- wait(160);
- yield;
- }
- }
- //Wait Function
- function wait(w){
- loop(w) {yield;}
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment