# Shooter Game HELP

**URL:** <https://forum.kirupa.com/t/shooter-game-help/258759>\
**Category:** programming\
**Created:** [April 27, 2008, 11:36pm UTC](https://forum.kirupa.com/t/shooter-game-help/258759 "2008-04-27T23:36:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lancerawks](https://avatars.discourse-cdn.com/v4/letter/l/4da419/32.png) [@lancerawks](https://forum.kirupa.com/u/lancerawks)\
**Post date:** [April 27, 2008, 11:36pm UTC](https://forum.kirupa.com/t/shooter-game-help/258759/1 "2008-04-27T23:36:47Z")

</div>

Ok, im makeing a side scroller shooter game where you point and click to shoot with your mouse. I wanted to make it so instead of actualy shooting a bullet movie clip out of your gun on mouseDown, just have a line apear for a split second between your gun and the enemy.

To do this i used the pythagoron therom (a^2 + b^2 = c^2)  
in the code its:  
x = \_root.hero.\_x - \_xmouse  
y = \_root.hero.\_y - \_ymouse  
\_root.hyp = Math.sqrt(x_x + y_y)

Then i made a movie clip of a line and set its \_xscale to c, and then set the lines \_rotation to the same as the guns

my only problem is when the line rotates around it becomes thicker and thiner, also at a point the line stops growing and there is a gap between the gun and the enemy. how can i fix this? id i do the pythagorian equation wrong or something?
