Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function fire()
- {
- if(reloaded)
- {
- x=_root.getNextHighestDepth();
- var bullet:MovieClip=_root.attachMovie("bullet", "bullet"+x, x);
- bullet._x=Weapon_MC._x;
- bullet._y=Weapon_MC._y;
- randomNum=random(bulletOffset)/2;
- bullet._rotation=Weapon_MC._rotation+randomNum;
- bullet.xSpeed=Math.cos(Math.PI/-270 * bullet._rotation)*bulletSpeed;
- bullet.ySpeed=Math.sin(Math.PI/-90 * bullet._rotation)*bulletSpeed;
- bullet.life=0;
- bullet.onEnterFrame=function()
- {
- this._x+=this.xSpeed;
- this._y+=this.ySpeed;
- this.life++;
- if(this.life>totalLife)
- {
- this.removeMovieClip();
- this.unloadMovie();
- };
- trace([this, _root.enemy_mc,this.hitTest(_root.enemy_mc]
- if (this.hitTest(_root.enemy_mc))
- {
- trace ("ENEMY HITTTTTTTTTTTTTTTTT");
- this.removeMovieClip();
- }
- };
- reload();
- };
- };
Advertisement
Add Comment
Please, Sign In to add comment