Closed sourcerose closed 3 years ago
Hi, so there are a couple of factors here:
movement
component. The default implementation is, when you're pressing a key then a force is exerted (the force is reduced if you're not on the ground). If no move key is being pressed, no force is exerted.So the result is, when a player is moving, and releases the move key, if they're on the ground they will be stopped by friction, and if they're in the air they'll keep moving since no forces are applied.
If you want to change this, you can remove the default movement
component from the player entity and add your own custom one. I.e.:
noa.entities.removeComponent(noa.playerEntity, noa.entities.names.movement)
noa.entities.addComponent(noa.playerEntity, yourMovementComponent)
I put the move code in a component like that to make it easy to override, since I assume most games will want to customize it.
Ah I see, so when the player is jumping up and down, they don't stick to the ground, so there is less friction
Thanks, got it fixed!
If you walk forward while jumping, then release the forward key, you continue moving forwards. Not sure if this is a bug or expected but I was wondering how I could remove it.