Mr.Pancake
July 5th, 2005, 09:43 AM
im making some sort of shooting game where u can rotate the guy 360 deg. with your mouse.. so the guy keeps following your mouse...
now my problem is how can i make him shoot?.
if u need the AS here is it for the guy :
onClipEvent (load) {
X = this._x;
Y = this._y;
}
onClipEvent (mouseMove) {
Xm = _parent._xmouse;
Ym = _parent._ymouse;
Xdiff = Xm-X;
Ydiff = Ym-Y;
radAngle = Math.atan2(Ydiff, Xdiff);
this._rotation = radAngle*360/(2*Math.PI);
updateAfterEvent();
}
now my problem is how can i make him shoot?.
if u need the AS here is it for the guy :
onClipEvent (load) {
X = this._x;
Y = this._y;
}
onClipEvent (mouseMove) {
Xm = _parent._xmouse;
Ym = _parent._ymouse;
Xdiff = Xm-X;
Ydiff = Ym-Y;
radAngle = Math.atan2(Ydiff, Xdiff);
this._rotation = radAngle*360/(2*Math.PI);
updateAfterEvent();
}