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

How to access a php class file from PHPFox framework into javascript code written in simple HTML file? -

node.js - Using Node without global install -

java - JavaScript + Thymeleaf - select onchange -