Advertisement
Guest User

h

a guest
May 23rd, 2013
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.25 KB | None | 0 0
  1.     sub spawn{
  2.  
  3.         CreateEnemyFromScript("spin",GetClipMinX+20,GetCenterY+50,0,0,0);
  4.        
  5.     }
  6. }
  7.  
  8. script_enemy spin{
  9.  
  10.     let CSD = GetCurrentScriptDirectory;
  11.     let imgDerp = CSD ~ "img\enemy1.png";
  12.  
  13.     @Initialize{
  14.        
  15.         SetLife(999999);
  16.         LoadGraphic(imgDerp);
  17.    
  18.         mainTask;
  19.     }
  20.  
  21.     @MainLoop{
  22.  
  23.         SetCollisionB(GetX,GetY,24);
  24.     }
  25.  
  26.     @DrawLoop{
  27.  
  28.         SetTexture(imgDerp);
  29.         SetRenderState(ALPHA);
  30.         SetAlpha(255);
  31.         SetGraphicScale(1,1);
  32.         SetGraphicAngle(0,0,0);
  33.         SetGraphicRect(0,0,45,40);
  34.         if(GetSpeedX>=-5){
  35.             ascent(anim in 0..3){
  36.                 if(f>=(anim*10) && f<((anim*10)+10) ){ SetGraphicRect(0+(anim*45), 0+(anim*40), 45+(anim*45), 40+(anim*40));}
  37.  
  38.             }
  39.             f++;
  40.             if(f==30){f=0;}
  41.         }
  42.  
  43.         DrawGraphicRect(imgDerp);
  44.  
  45.     }
  46.  
  47.     @Finalize{
  48.  
  49.         DeleteGraphic(imgDerp);
  50.  
  51.     }
  52.  
  53.     task mainTask{
  54.    
  55.         fire;
  56.         yield;
  57.  
  58.         task fire{
  59.  
  60.             wait(120);
  61.             let x = 0;
  62.             let dir = 0;
  63.  
  64.             loop{
  65.                 while(x<5){
  66.                    
  67.                     CreateShot01(GetX+5, GetY+20, 5, dir+90, WHITE05, 0);
  68.  
  69.                     dir+=45/5;
  70.            
  71.                     x++;
  72.                
  73.                     }
  74.  
  75.                 x = 0;
  76.                 dir = 0;
  77.                 wait(2);
  78.                 yield;
  79.  
  80.             }
  81.  
  82.         }
  83.        
  84.         task movement{
  85.            
  86.             wait(60);
  87.             SetMovePosition01(GetEnemyX-25,GetEnemyY+50,5);
  88.            
  89.         }
  90.  
  91.     function wait(w){
  92.         loop(w){yield;}        
  93.  
  94.         }
  95.  
  96.     }
  97. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement