abstract class Scar::Action
- Scar::Action
- Reference
- Object
Overview
Base class for one-off actions
Sample usage:
class MyAction < Scar::Action
def completed?(dt)
true # This action completes instantly
end
def on_start
puts "MyAction start!"
end
def on_end
puts "MyAction end!"
end
end
# Somewhere in your application
app.act MyAction.new
# Output:
# MyAction start!
# MyAction end!
Direct Known Subclasses
Defined in:
scar/action.crInstance Method Summary
-
#completed?(dt : Float32)
Should return true as soon as the action has finished
-
#on_end
This method is called immediately after
#completed?
returned true on a frame -
#on_start
This method is called immediately after the action was activated via
Scar::App#act
Instance Method Detail
def completed?(dt : Float32)
#
Should return true as soon as the action has finished
This method is called on each frame with the delta time as an argument.
#on_end
is called after this method returns true.
By default, an action completes immediately.