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
Attributes inherited from Action
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
Methods inherited from Action
#copy, #initialize, #start, #started?, #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.
78 79 80 |
# File 'lib/zyps/actions.rb', line 78 def rate @rate end |
Instance Method Details
#do(actor, targets) ⇒ Object
Increase or decrease speed according to elapsed time.
80 81 82 |
# File 'lib/zyps/actions.rb', line 80 def do(actor, targets) actor.vector.speed += delta end |