Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by PabloAM

On the demo, the player is still "Jumping" when the elevator is going at bottom.

Any fix for that?

Thanks

1 decade ago by alexandre

Pablo, are you talking about this? Let me know and if so, I'll look into it.

1 decade ago by paulh

yea that jumping/bounce on platforms is annoying :-)

10 years ago by fulvio

Did anyone figure out how to make the player stick to the platform rather than jump up when the platform reaches the top and moves the opposite direction?

10 years ago by quidmonkey

Yes, check to the see if the player is standing on the platform and apply a small force into the platform:
if (other.pos.y < this.pos.y) {
    other.standing = true;
    other.vel.y = ig.game.gravity / 4;
}

10 years ago by fulvio

Thanks quidmonkey!

10 years ago by fulvio

quidmonkey, just wanted to make sure you were talking about placing the code within the check() function of the Platform entity? If so, the code doesn't seem to be making the player stick.

I'll have a bit more of a play around and see what I can do.

type: ig.Entity.TYPE.B,
checkAgainst: ig.Entity.TYPE.A,
collides: ig.Entity.COLLIDES.FIXED,
check: function(other) {
    if (other.pos.y < this.pos.y) {
        other.standing = true;
        other.vel.y = ig.game.gravity / 4;
    }
}

10 years ago by quidmonkey

Put it in collideWith, and the gravity / 4 is likely too strong. Try gravity / 8 or 10.

10 years ago by fulvio

The following works beautifully:

type: ig.Entity.TYPE.B,
checkAgainst: ig.Entity.TYPE.A,
collides: ig.Entity.COLLIDES.FIXED,
collideWith: function(other, axis) {
    if (other.pos.y < this.pos.y) {
        other.standing = true;
        other.vel.y = ig.game.gravity / 8;
    }
}

Thanks @quidmonkey.
Page 2 of 2
« first ‹ previous next › last »