Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

1.1.4 Physics


RestingCoder
 Share

Recommended Posts

I have been using the dev branch for a couple weeks, and everything was going well. Now, I have switched to the release version of 1.1.4, and made what I believe are all the changes needed to make things work. However, for something as simple as causing my player sprite to jump, it does not work.

 

This code snippet is for my player class, extended from sprite:

console.log(this.body.onFloor());    if (this.jumpButton.isDown && this.body.onFloor() && this.game.time.now > this.jumpTimer) {        console.log('beep');        this.body.velocity.y = -720;        this.jumpTimer = this.game.time.now + 250;    }

'beep' is triggered, but the sprite does not move. At all.

 

I have also found that this code only works if I am already moving horizontally

if (this.arrowKeys.up.isDown) {        this.body.velocity.y = -400;}

You can see an example of this here:  http://play.reminiscencegame.com/example2/

Link to comment
Share on other sites

minVelocity was already set as a test, and I have tried adding various values for linearDamping. Interestingly enough, if I set the bounce at all (no matter the value), the player sprite will stop moving entirely if it touches any walls.

 

I am also seeing an issue where the sprite is not dropping like it should. To reproduce this, use the up arrow in the example I linked previously, and land on any of the platforms that aren't what you would consider the floor. Now, move left or right, off the platform. You will basically be stuck in the air until you move along the y axis again.

 

I really have no idea what is going on here, but all of this works perfectly with what was in the dev branch up until a day or two ago.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...