# Shoot with gravity

**URL:** <https://forum.kirupa.com/t/shoot-with-gravity/150154>\
**Category:** Uncategorized\
**Created:** [June 4, 2005, 10:54am UTC](https://forum.kirupa.com/t/shoot-with-gravity/150154 "2005-06-04T10:54:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![alekos](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@alekos](https://forum.kirupa.com/u/alekos)\
**Post date:** [June 4, 2005, 10:54am UTC](https://forum.kirupa.com/t/shoot-with-gravity/150154/1 "2005-06-04T10:54:47Z")

</div>

hello i have this code for the rotation of a cannon movie clip onClipEvent (enterFrame) {  
if (!\_root.motionFlag) {

myRadians = Math.atan2(\_root.\_ymouse-this.\_y, \_root.\_xmouse-this.\_x);  
myDegrees = Math.round((myRadians\*180/Math.PI));  
\_root.yChange = Math.round(\_root.\_ymouse-this.\_y);  
\_root.xChange = Math.round(\_root.\_xmouse-this.\_x);  
this.\_rotation = myDegrees+145;  
}  
}  
and i want when i push on it a ball will follow the angle of the cannon but not straight but with gravity can anyone help!!!
