Closed EliteAsian123 closed 5 years ago
Hey, this is all done through noa's entity component system.
You'll see that noa has a playerEntity
property; this will give you the id of the player entity.
From that, you can access the player's components and states through noa.entities
.
For example, you can modify the number of jumps the player can do like so:
// Get the player's movement state
const movementState = noa.entities.getMovement(noa.playerEntity);
// Don't allow double jumps
movementState.airJumps = 0;
// Allow one air jump (double jump)
movementState.airJumps = 1;
// Allow two air jumps (triple jump)
movementState.airJumps = 2;
Hope that helps!
I'll just add - many settings can be passed in as properties on the options object, but adding a setting for max air jumps is one I haven't gotten around to yet. But yeah, the runtime value for all entity settings lives in state objects in the ECS.
Thanks for the answer! It work perfectly. Have a good day!
How do I change the options of the player like whether if it can double jump?