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
Post a Comment