Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sub spawn{
- CreateEnemyFromScript("spin",GetClipMinX+20,GetCenterY+50,0,0,0);
- }
- }
- script_enemy spin{
- let CSD = GetCurrentScriptDirectory;
- let imgDerp = CSD ~ "img\enemy1.png";
- @Initialize{
- SetLife(999999);
- LoadGraphic(imgDerp);
- mainTask;
- }
- @MainLoop{
- SetCollisionB(GetX,GetY,24);
- }
- @DrawLoop{
- SetTexture(imgDerp);
- SetRenderState(ALPHA);
- SetAlpha(255);
- SetGraphicScale(1,1);
- SetGraphicAngle(0,0,0);
- SetGraphicRect(0,0,45,40);
- if(GetSpeedX>=-5){
- ascent(anim in 0..3){
- if(f>=(anim*10) && f<((anim*10)+10) ){ SetGraphicRect(0+(anim*45), 0+(anim*40), 45+(anim*45), 40+(anim*40));}
- }
- f++;
- if(f==30){f=0;}
- }
- DrawGraphicRect(imgDerp);
- }
- @Finalize{
- DeleteGraphic(imgDerp);
- }
- task mainTask{
- fire;
- yield;
- task fire{
- wait(120);
- let x = 0;
- let dir = 0;
- loop{
- while(x<5){
- CreateShot01(GetX+5, GetY+20, 5, dir+90, WHITE05, 0);
- dir+=45/5;
- x++;
- }
- x = 0;
- dir = 0;
- wait(2);
- yield;
- }
- }
- task movement{
- wait(60);
- SetMovePosition01(GetEnemyX-25,GetEnemyY+50,5);
- }
- function wait(w){
- loop(w){yield;}
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement