Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- script_enemy_main{
- let CSD = GetCurrentScriptDirectory;
- let enemy = CSD ~ "system/fairies.png";
- let f = 0;
- let f2 = 0;
- let sfx1 = CSD ~ "sfx/Shot1.wav";
- @Initialize{
- SetLife(10);
- LoadGraphic(enemy);
- LoadSE(sfx1);
- mainTask;
- }
- @MainLoop{
- yield;
- }
- @DrawLoop{
- SetTexture(enemy);
- SetRenderState(ALPHA);
- SetAlpha(255);
- SetGraphicScale(1,1);
- SetGraphicAngle(0,0,0);
- if(int(GetSpeedX())==0){
- if(f<10){ SetGraphicRect(0,0,30,27); }
- if(f>=10 && f<20){ SetGraphicRect(30,0,60,27); }
- if(f>=20 && f<30){ SetGraphicRect(60,0,90,27); }
- if(f>=30 && f<40){ SetGraphicRect(90,0,120,27); }
- if(f>=40 && f<50){ SetGraphicRect(120,0,150,27); }
- f2=0;
- }
- if(GetSpeedX()>0){
- if(f2<5){ SetGraphicRect(150,0,180,27); }
- if(f2>=5 && f2<10){ SetGraphicRect(180,0,210,27); }
- if(f2>=10 && f2<15){ SetGraphicRect(210,0,240,27); }
- if(f2>=15 && f2<20){ SetGraphicRect(240,0,270,27); }
- if(f2<20 && f2<25){ SetGraphicRect(300,0,330,27); }
- if(f2>=25 && f2<30){ SetGraphicRect(360,0,390,27); }
- if(f2>=30 && f2<35){ SetGraphicRect(420,0,450,27); }
- if(f2>=40 && f2<45){ SetGraphicRect(450,0,480,27); }
- f2++;
- }
- if(GetSpeedX()<0){
- SetGraphicAngle(180,0,0);
- if(f2<5){ SetGraphicRect(150,0,180,27); }
- if(f2>=5 && f2<10){ SetGraphicRect(180,0,210,27); }
- if(f2>=10 && f2<15){ SetGraphicRect(210,0,240,27); }
- if(f2>=15 && f2<20){ SetGraphicRect(240,0,270,27); }
- if(f2<20 && f2<25){ SetGraphicRect(300,0,330,27); }
- if(f2>=25 && f2<30){ SetGraphicRect(360,0,390,27); }
- if(f2>=30 && f2<35){ SetGraphicRect(420,0,450,27); }
- if(f2>=40 && f2<45){ SetGraphicRect(450,0,480,27); }
- f2++;
- }
- DrawGraphic(GetX,GetY);
- f++;
- if(f==40){f=0;}
- }
- }
- @Background{
- }
- @Finalize{
- DeleteGraphic(enemy);
- DeleteSE(sfx1);
- }
- task mainTask{
- move;
- }
- task move{
- loop(5){
- wait(60);
- atk;
- }
- }
- task atk{
- let x = 0;
- let dir = 0;
- loop(5){
- PlaySE(sfx1);
- while(x<36){
- CreateShotA(1,GetEnemyX,GetEnemyY,10);
- SetShotDataA(1,0,1,dir,0,0.1,4,AQUA01);
- FireShot(1);
- dir+=360/24;
- x++;
- }
- x = 0;
- dir = 0;
- wait(5);
- yield;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement