html5 - Phaser-Projectiles being affected by gravity -


i set gravity 1000 in create function :

game.physics.arcade.gravity.y = 1000; 

but when intergraded projectiles in 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 being affected gravity, being dragged ground when projectile being launched. how make shoots in straight line, while other objects shot being affected gravity.


Comments

Popular posts from this blog

java - Null response to php query in android, even though php works properly -

node.js - Using Node without global install -

php - CakePHP HttpSockets send array of paramms -