Elinchat Posted March 17, 2017 Report Share Posted March 17, 2017 Hello, I want to find how can I fix this problem about two players's hitboxes. When I press down, I change ths size of the hitbox but it go throught the other hitbox. function deplacementJoueur2(){ joueur2.body.velocity.x = 0; // joueur2.animations.stop(); joueur2.frame = 0; if (toucheQ.isDown) { joueur2.body.velocity.x = -400; joueur2.animations.play('left2'); }if (toucheD.isDown) { joueur2.body.velocity.x = (400); joueur2.animations.play('right2'); }if (toucheS.isDown) { joueur2.frame = 27; joueur2.anchor.setTo(1, 1); joueur2.body.setSize(110/2, 122/2); joueur2.animations.play('down2'); } else { joueur2.body.setSize(110,122); } if (toucheZ.isDown && game.time.now > jumpTimer2) { joueur2.body.velocity.y = -300; jumpTimer2 = game.time.now + 750; joueur2.animations.play('jump2'); } } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.