Currently i'm using this code to fire a bullet towards my mouse:
This kinda works good, but the bullet is moving way to slow, is there a way of speeding it up?
Code:
diffX = stage.mouseX - (map2D.player.playerBox.x + map2D.x);
diffY = stage.mouseY - (map2D.player.playerBox.y + map2D.y);
var direction:b2Vec2 = new b2Vec2(diffX / MapBox2D.RATIO, diffY/ MapBox2D.RATIO);
direction.Normalize();
bulletBody.ApplyImpulse(direction, map2D.player.playerBody.GetPosition());
diffY = stage.mouseY - (map2D.player.playerBox.y + map2D.y);
var direction:b2Vec2 = new b2Vec2(diffX / MapBox2D.RATIO, diffY/ MapBox2D.RATIO);
direction.Normalize();
bulletBody.ApplyImpulse(direction, map2D.player.playerBody.GetPosition());
This kinda works good, but the bullet is moving way to slow, is there a way of speeding it up?