Federayk Posted September 7, 2018 Share Posted September 7, 2018 Hi guys! I'm new on Phaser (I use 2 version). I was create a placeholder and when I set movement of the player, specifically in the jump, doesn't work. Everything works but expect the jump. I let one fragment of the code and also the file. I couldn't find solution for now. I will be grateful with any help. Thank you! :) update:function(){ //COLLISION PLAYER AND TILESLAYER game.physics.arcade.collide(this.player, this.layer); //MOVEMENT OF PLAYER this.player.body.velocity.x = 0; if (this.cursors.left.isDown) { this.player.body.velocity.x -= 300 this.player.animations.play('walking.l'); } else if (this.cursors.right.isDown) { this.player.body.velocity.x += 300; this.player.animations.play('walking.r') } else { //PLAYER DON'T MOVE this.player.body.velocity.x = 0 this.player.frame = 0; this.player.animations.stop(); } //JUMP if (this.cursors.up.isDown && this.player.body.touching.down) { this.player.body.velocity.y -= 120; } liquidadores.rar Link to comment Share on other sites More sharing options...
Federayk Posted September 8, 2018 Author Share Posted September 8, 2018 Hi! I tried that but it still doesn't work ? When I turned -= 300 to = -300 in this.player.body.velocity.x as well as in this.player.body.velocity.y But nothing has been changed. The player don't jump when is touching the ground as well as when is not touching the ground. In both cases nothing happens. Link to comment Share on other sites More sharing options...
Milton Posted September 9, 2018 Share Posted September 9, 2018 Federayk 1 Link to comment Share on other sites More sharing options...
Federayk Posted September 9, 2018 Author Share Posted September 9, 2018 Oh! After to ckeck that, I turn this.player.touching.down to this.player.blocked.down and that's work! Thank you so much! Link to comment Share on other sites More sharing options...
Recommended Posts