# My code

**URL:** <https://forum.kirupa.com/t/my-code/150043>\
**Category:** Uncategorized\
**Created:** [June 3, 2005, 6:58am UTC](https://forum.kirupa.com/t/my-code/150043 "2005-06-03T06:58:12Z")\
**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 3, 2005, 6:58am UTC](https://forum.kirupa.com/t/my-code/150043/1 "2005-06-03T06:58:12Z")

</div>

here is my code for the shooting with angle but it isn’t running please someone help me kanoni is the cannon movie clip and sfaira is the ball

\_root.createEmptyMovieClip();  
onMouseDown = function () {  
g = 9.81;  
v = 1;  
cos\_angle = Math.cos(\_level0.kanoni.myDegrees);  
sin\_angle = Math.sin(_level0.kanoni.myDegrees);_  
root.sfaira.\_visible = 1;  
\_root.sfaira.\_x = \_root.kanoni.\_x;  
\_root.sfaira.\_y = \_root.kanoni.\_y;  
for (var i = 0; i\<155; i += 0.1) {  
balla\_x = (v_v/g)_(sin\_angle);  
balla\_y = (v_v/g)_(sin\_angle)\*(sin\_angle);  
\_root.sfaira.\_x = \_root.sfaira.\_x+balla\_x;  
\_root.sfaira.\_y = \_root.sfaira.\_y+balla\_y;}};
