Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function bullfire(type) { //spawnpoint = 1, 2, 3
- //for (d = 0; d < 3; d++) {
- if(depthb > 1226){depthb=depthconstb}
- bull = attachMovie("bullet1", "bull" + depthb, depthb++);
- bull.meid = type;//random(10)+1
- bull.gotoAndStop(bull.meid)
- bull._x = cell1._x;
- bull._y = cell1._y;
- dir = Math.atan2(_root.cell1._y - _root._ymouse, _root.cell1._x - _root._xmouse)
- myDegrees = Math.round((dir*180/Math.PI));;
- bull._rotation = myDegrees;
- bullspeed = -10;
- bull.xSpeed = Math.cos(dir) * bullspeed;
- bull.ySpeed = Math.sin(dir) * bullspeed;
- //bull.health = 100;
- bull.meactive = 1;
- bull.dammage = 100;
- bulls.push(bull);
- //}
- }
- function onEnterFrame() {
- spawnrate++;
- if(spawnrate>spawnrateconst){
- makecell(1);
- spawnrate = 0;
- }
- for (d = bulls.length - 1; d >= 0; d--) {
- bull = bulls[d]
- bull._x += bull.xSpeed;
- bull._y += bull.ySpeed;
- }
- for (c = chars.length - 1; c >= 0; c--) {
- char = chars[c];
- for (e = bulls.length - 1; e >= 0; e--) {
- bull = bulls[e];
- if (char.hitTest(bull)){if(bull.meactive==1){
- bull.meactive =0 ;
- bull.xSpeed = 0;
- bull.ySpeed = 0;
- bull.play();
- bull.removeMovieClip();
- char.health = char.health - bull.dammage;
- if(char.health < 0){
- celldie(e);trace('die');char.cell.play();char.meactive = 0;}
- }
- }
- }
- char._x += char.xSpeed * pumpspeed;
- char._y += char.ySpeed * pumpspeed;
- if (char.hitTest(dotArrays[char.dotTo][char.Target])) {
- dir = Math.atan2(_root.cell1._y - char._y, _root.cell1._x - char._x);
- //char.xSpeed = Math.cos(dir);
- //char.ySpeed = Math.sin(dir);
- }
- if (char.hitTest(_root.cell1)) {
- //
- //if(char.enemy == 1 && char.meactive == 1){Hurt(-1, 1);_root.soundbox2.gotoAndPlay('hurt');}
- char.removeMovieClip();
- //chars.splice(c,1);
- }
- }
- }
- function celldie(cell){
- char = chars[cell];
- //Money(1,_global.currentkillpay)
- char.meactive = 0;
- char.cell.play();
- //from.kills ++
- _root.kills ++
- //trace(from.kills);
- }
Add Comment
Please, Sign In to add comment