# Shooting problem

**URL:** https://forum.kirupa.com/t/shooting-problem/153866
**Category:** Uncategorized
**Created:** [July 5, 2005, 12:43pm UTC](https://forum.kirupa.com/t/shooting-problem/153866 "2005-07-05T12:43:12Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Mr\_Pancake](https://avatars.discourse-cdn.com/v4/letter/m/58f4c7/32.png) [@Mr\_Pancake](https://forum.kirupa.com/u/Mr_Pancake)
#### Post date: [July 5, 2005, 12:43pm UTC](https://forum.kirupa.com/t/shooting-problem/153866/1 "2005-07-05T12:43:12Z")

</div>

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();  
> }
