raphaklaus Posted December 29, 2016 Share Posted December 29, 2016 Hello! I've created an example to illustrate what's going on. Sorry for the big data-urls https://jsfiddle.net/yero3zt8/2/ If you press space, the square jumps out of the ground, but when it reaches the ground again it takes one update cycle to give the jumping box velocity. Once the ground is moving continuously, this situation creates a drag. I think I'm missing something, maybe a better update logic or a method call. How do you guys are solving this situation in your games? Link to comment Share on other sites More sharing options...
drhayes Posted December 30, 2016 Share Posted December 30, 2016 Can you set the body.x to 100 every time in update? Link to comment Share on other sites More sharing options...
samme Posted December 30, 2016 Share Posted December 30, 2016 Try box.body.friction.set(0); Link to comment Share on other sites More sharing options...
raphaklaus Posted December 30, 2016 Author Share Posted December 30, 2016 1 hour ago, samme said: Try box.body.friction.set(0); I've added it to create, and it doesn't works. 2 hours ago, drhayes said: Can you set the body.x to 100 every time in update? No, because it will mess the physics in the game since I use Arcade Physics... Link to comment Share on other sites More sharing options...
samme Posted December 31, 2016 Share Posted December 31, 2016 Make sure you're using a recent Phaser. The version in the example (2.0.3) doesn't have body.friction. Try if (jumping) { box.body.velocity.x = 0; largeBox.body.friction.x = 0; } else { box.body.velocity.x = 200; largeBox.body.friction.x = 1; } https://jsfiddle.net/qrdzpz47/4/ raphaklaus 1 Link to comment Share on other sites More sharing options...
Recommended Posts