Guest User

Untitled

a guest
Jun 25th, 2018
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function bullfire(type) { //spawnpoint = 1, 2, 3
  2.         //for (d = 0; d < 3; d++) {
  3.         if(depthb > 1226){depthb=depthconstb}
  4.         bull = attachMovie("bullet1", "bull" + depthb, depthb++);
  5.         bull.meid = type;//random(10)+1
  6.         bull.gotoAndStop(bull.meid)
  7.         bull._x = cell1._x;
  8.         bull._y = cell1._y;
  9.         dir = Math.atan2(_root.cell1._y - _root._ymouse, _root.cell1._x - _root._xmouse)
  10.         myDegrees = Math.round((dir*180/Math.PI));;
  11.         bull._rotation = myDegrees;
  12.         bullspeed = -10;
  13.         bull.xSpeed = Math.cos(dir) * bullspeed;
  14.         bull.ySpeed = Math.sin(dir) * bullspeed;
  15.         //bull.health = 100;
  16.         bull.meactive = 1;
  17.         bull.dammage = 100;
  18.         bulls.push(bull);
  19.         //}
  20.        
  21. }
  22.  
  23.  
  24.  
  25.  
  26. function onEnterFrame() {
  27.    
  28.     spawnrate++;
  29.     if(spawnrate>spawnrateconst){
  30.         makecell(1);
  31.         spawnrate = 0;
  32.         }
  33.    
  34.     for (d = bulls.length - 1; d >= 0; d--) {
  35.         bull = bulls[d]
  36.         bull._x += bull.xSpeed;
  37.         bull._y += bull.ySpeed;
  38.     }
  39.     for (c = chars.length - 1; c >= 0; c--) {
  40.         char = chars[c];
  41.  
  42.         for (e = bulls.length - 1; e >= 0; e--) {
  43.             bull = bulls[e];
  44.             if (char.hitTest(bull)){if(bull.meactive==1){
  45.                 bull.meactive =0 ;
  46.                 bull.xSpeed = 0;
  47.                 bull.ySpeed = 0;
  48.                 bull.play();
  49.                 bull.removeMovieClip();
  50.                 char.health = char.health - bull.dammage;
  51.                 if(char.health < 0){
  52.                     celldie(e);trace('die');char.cell.play();char.meactive = 0;}
  53.                     }
  54.                 }
  55.         }
  56.        
  57.         char._x += char.xSpeed * pumpspeed;
  58.         char._y += char.ySpeed * pumpspeed;
  59.         if (char.hitTest(dotArrays[char.dotTo][char.Target])) {
  60.             dir = Math.atan2(_root.cell1._y - char._y, _root.cell1._x - char._x);
  61.             //char.xSpeed = Math.cos(dir);
  62.             //char.ySpeed = Math.sin(dir);
  63.            
  64.            
  65.         }
  66.         if (char.hitTest(_root.cell1)) {
  67.             //
  68.             //if(char.enemy == 1 && char.meactive == 1){Hurt(-1, 1);_root.soundbox2.gotoAndPlay('hurt');}
  69.            
  70.             char.removeMovieClip();
  71.             //chars.splice(c,1);
  72.         }
  73.     }
  74.    
  75. }
  76.  
  77.  
  78.         function celldie(cell){
  79.             char = chars[cell];
  80.             //Money(1,_global.currentkillpay)
  81.             char.meactive = 0;
  82.             char.cell.play();
  83.             //from.kills ++
  84.             _root.kills ++
  85.             //trace(from.kills);
  86.             }
Add Comment
Please, Sign In to add comment