-
Hey! Not sure if bug or not ;) I had some problems getting my Actions to run. When troubleshooting I found out that I had override update(engine: Engine, delta: number) {
if (engine.input.keyboard.isHeld(Input.Keys.W)) {
this.velocity = Vector.Up;
} else if (engine.input.keyboard.isHeld(Input.Keys.A)) {
this.velocity = Vector.Left;
} else if (engine.input.keyboard.isHeld(Input.Keys.D)) {
this.velocity = Vector.Right;
} else if (engine.input.keyboard.isHeld(Input.Keys.S)) {
this.velocity = Vector.Down;
}
} I were able to create and queue actions but no actions fired... There is a system to run actions in update that is abstracted away but I had no clue this was causing it. To make actions run I needed to call the super update as well, is this intentional? If so this could be explained in Actions docs section to prevent this pitfall. update(engine: Engine, delta: number) {
...inputs
super.update(engine,delta);
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @nilskj apologies for the pitfall, this is indeed the case in the current version of Excalibur that the Actions is one of the last things to be refactored out of the I've added a couple updates to the documentation to note this requirement |
Beta Was this translation helpful? Give feedback.
Hi @nilskj apologies for the pitfall, this is indeed the case in the current version of Excalibur that the
super.update()
must be called to preserve the action behavior.Actions is one of the last things to be refactored out of the
Actor.update()
, the plan is to implement the Actions API with an ECS Component/System in the next version removing the need to call thesuper.update()
.I've added a couple updates to the documentation to note this requirement