new Mover()
This component handles entity motion via velocity and acceleration changes. This is useful for directional movement, gravity, bounce-back collision reactions, jumping, etc.
- Source:
Listens to Events:
- platypus.Entity#event:component-added
- platypus.Entity#event:component-removed
- platypus.Entity#event:handle-movement
- platypus.Entity#event:handle-post-collision-logic
- platypus.Entity#event:hit-solid
- platypus.Entity#event:load
- platypus.Entity#event:pause-movment
- platypus.Entity#event:orientation-updated
- platypus.Entity#event:set-mover
- platypus.Entity#event:unpause-movment
Methods
addMover(mover) → {Motion}
This method adds a mover to the entity in the form of a "Motion" component definition.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
mover |
Object
|
For motion definition properties, see the "Motion" component. |
Returns:
- Type:
-
Motion
motion
removeMover(motion)
This method removes a mover from the entity.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
motion |
Motion
|