I set gravity to 1000 in the create function like so :
game.physics.arcade.gravity.y = 1000;
But then when I intergraded projectiles in its own function:
function shootr(){
if (canshoot) {
if (attackTimer< game.time.now) {
attackTimer = game.time.now + 500;
var projectile;
projectile = projectiles.create(
player.body.x + player.body.width / 2,
player.body.y + player.body.height / 2,
'powerball');
game.physics.enable(projectile, Phaser.Physics.ARCADE);
projectile.outOfBoundsKill = true;
projectile.anchor.setTo(0.5, 0.5);
projectile.body.velocity.x = 400;
}
}
}
The projectile is being affected by gravity, being dragged to the ground when the projectile is being launched. How would I make it so it shoots in a straight line, while the other objects shot are being affected by gravity.