RielDFC Posted September 27, 2016 Share Posted September 27, 2016 I'm using identical code to the Phaser tutorial with arcade physics. The only thing really different in this regard is the size of the canvas is 960 x 640 rather than 800x600, but for some reason the gravity (of 300) is MUCH slower and the player.body.velocity.y ( -250) is pretty much not moving the player at all. player = game.add.sprite(32, 485, 'dude'); game.physics.arcade.enable(player); player.animations.add('right', [5, 6, 7, 8], 10, true); player.body.gravity.y = 300; player.body.collideWorldBounds = true; // Allow the player to jump if they are touching the ground. if (cursors.up.isDown && player.body.touching.down) { player.body.velocity.y = -250; }; I can set these so they do move faster and further, but the player.body.velocity.y has to be set to about -25000 to go a little over half way up the screen, and there's no upward jump. the player literally starts at his resting point, appears at the highest jump height and then gravity actually works and slowly falls. Is there something i might be missing here? Any help would be appreciated. Link to comment Share on other sites More sharing options...
rgk Posted September 27, 2016 Share Posted September 27, 2016 Can you show a more in-depth example? It might be a combination of the sprite gravity + world gravity causing an issue. Link to comment Share on other sites More sharing options...
RielDFC Posted September 27, 2016 Author Share Posted September 27, 2016 Nevermind i finally just figured it out. I was resetting player.body.velocity.y to 0 in the update function for some reason and never thought to remove it. Link to comment Share on other sites More sharing options...
Recommended Posts