Actions
Actions are reusable, well, actions which can last longer than an instant. This could be anything from just a delayed action, a soundeffect to a player jump.
An action has its own update function completed?
. It is called that way because it also returns the state of the action (if it is completed). There also the on_start
and on_end
functions which can be overriden and are called on the appropriate times.
An action is initiated via the App#act
method. First, the Action#on_start
method is called. After that, the Action#completed?
function is called every frame until it returns true. Then Action#on_end
is called and the action removed.
There are builtin actions as well. They are explained in the 'Builtin Actions' chapter of this book.
Last updated