mspraggs / potentia

Southampton Game Jam 2015
0 stars 0 forks source link

No more Sticky Walls #111

Closed DivFord closed 8 years ago

DivFord commented 8 years ago

The player's jump height is lower while next to a wall. This feels really weird. How can we fix it without breaking the rest of the physics system?

Fyll commented 8 years ago

Okay, this is more of a reminder for myself than a genuine response, but anyway:

The problem is friction (as ever). The easiest solution would be to just turn vertical friction off. This would have the problem that there would then be no vertical friction anywhere, and it would probably be nice to have some things that want vertical friction (maybe enemies that walk on the walls?).

Of course, I could just put in a check to see if you're the Player, which would solve the above problem. The drag is a Vector at the moment, so just ignoring an axis should be easy (although I don't think it builds the Vector sensibly, so that'll probably need to be sorted out first).

DivFord commented 8 years ago

Is it possible to ignore vertical friction only on the player and only when his vertical velocity is positive (i.e. moving upwards)? Just wondering if it's possible to keep wall sliding for downwards movement, since it's quite fun.

Fyll commented 8 years ago

Should be. If I'm putting an if(me->type() == OBJ_PLAYER) in, it'd be easy to also put && me->vel() > 0.0f into the statement (or whichever way around that should go).

Fyll commented 8 years ago

Okay. I've pushed a version with no drag when jumping next to walls (but still drag when falling). I'll call this done for now.