# Shooting bullets from a moving player

**URL:** https://forum.kirupa.com/t/shooting-bullets-from-a-moving-player/328947
**Category:** programming
**Created:** [July 5, 2012, 5:25pm UTC](https://forum.kirupa.com/t/shooting-bullets-from-a-moving-player/328947 "2012-07-05T17:25:07Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![SimoneS93](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@SimoneS93](https://forum.kirupa.com/u/SimoneS93)
#### Post date: [July 5, 2012, 5:25pm UTC](https://forum.kirupa.com/t/shooting-bullets-from-a-moving-player/328947/1 "2012-07-05T17:25:07Z")

</div>

I know probably there’re already solutions to this problem, but I cant’t find them. The problem is that I have a player which can be moved by arrow keys and rotate towards the mouse coordinates, and has a vx and a vy properties. When I fire a bullet, it goes towards the mouse too and also has a vx and a vy properties, but if the player is moving towards the mouse, it overcomes the bullets or it seems the bullets are moving slower. I tried to add to the bullets’ vx and vy the ship’s vx and vy, but it doesn’t work (some bullets move faster than the others). How can I solve the problem?
