Closed cmboros closed 7 years ago
I can't really comment on why this is happening without seeing any example code.
Thanks for the response I have create a gist https://gist.github.com/cmboros/6f469a7b22078a6ef4d22aefc8f2583e
Thnaks
https://gist.github.com/cmboros/6f469a7b22078a6ef4d22aefc8f2583e#file-player-js-L144-L155
These lines are why. Look at your conditions and what you're doing within them.
if (this.body.touching.right) {
if (this.jumpButton.isDown) {
this.scale.x = this.scale.x * -1;
this.body.velocity.y = -300;
this.body.acceleration.x = -20000;
}
} else if (this.body.touching.left) {
if (this.jumpButton.isDown) {
this.scale.x = this.scale.x * -1;
this.body.velocity.y = -300;
this.body.acceleration.x = 20000;
}
} else {
this.body.acceleration.x = 0;
}
All I had to do to find this was search body.velocity.y
.
If you want to make sure the player is on the ground when this runs, just wrap these blocks with a check for touching.down
:
if (this.body.touching.down) {
...
}
Also, celery is the best weapon. :smiling_imp:
Thanks a lot for the help. I forgot about that condition i just had to remove it.
Celery is useful when you fight with some other vegetables :).
Thanks again:)
Really great plugin just got one issue.
Every time the player is near a wall (FULL) and i press to the direction of the wall it do wall jump. Is any way to prevent this?
Thanks