Class: Zyps::AccelerateAction
- Inherits:
-
TimedAction
- Object
- Action
- TimedAction
- Zyps::AccelerateAction
- Defined in:
- lib/zyps/actions.rb
Overview
Increase/decrease speed over time.
Instance Attribute Summary collapse
-
#rate ⇒ Object
Units per second to accelerate.
Attributes inherited from TimedAction
Instance Method Summary collapse
-
#do(actor, targets) ⇒ Object
Increase or decrease speed according to elapsed time.
Methods inherited from TimedAction
#copy, #delta, #initialize, #start, #stop
Constructor Details
This class inherits a constructor from Zyps::TimedAction
Instance Attribute Details
#rate ⇒ Object
Units per second to accelerate. Can be negative to slow down or go in reverse.
79 80 81 |
# File 'lib/zyps/actions.rb', line 79 def rate @rate end |
Instance Method Details
#do(actor, targets) ⇒ Object
Increase or decrease speed according to elapsed time.
81 82 83 |
# File 'lib/zyps/actions.rb', line 81 def do(actor, targets) actor.vector.speed += delta end |