View Full Version : sum1 attach the bullet plz
killfrenze
October 12th, 2006, 05:41 PM
i need sum1 to make the bullet come out of the end of the gun in this game i am developing, could sum1 plz do it 2 save me alot of hasel.plz
SacrificialLamb
October 12th, 2006, 06:41 PM
make enther frame code this
onEnterFrame = function () {
var dx = _xmouse-gun._x;
var dy = _ymouse-gun._y;
var radians = Math.atan2(dy, dx);
gun._rotation = radians*180/Math.PI;
if (i>5) {
i = 0;
var obj:Object = {x:220, y:8};
_root.gun.localToGlobal(obj);
temp = _root.bullet.duplicateMovieClip("bul"+c, 20+c++);
temp._x = obj.x;
temp._y = obj.y;
temp._rotation = gun._rotation
temp.onEnterFrame = function () {
ang = this._rotation/180*Math.PI;
this._x += Math.cos(ang)*speed;
this._y += Math.sin(ang)*speed;
}
}
i++;
};
i = 0;
c = 0;
speed= 2
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.