Class: Zyps::TurnAction
- Inherits:
-
TimedAction
- Object
- Action
- TimedAction
- Zyps::TurnAction
- Defined in:
- lib/zyps/actions.rb
Overview
Apply a thrust that turns actor.
Instance Attribute Summary collapse
-
#angle ⇒ Object
Angle to turn at.
Attributes inherited from TimedAction
Instance Method Summary collapse
- #do(actor, targets) ⇒ Object
-
#initialize(rate, angle) ⇒ TurnAction
constructor
A new instance of TurnAction.
Methods inherited from TimedAction
Constructor Details
#initialize(rate, angle) ⇒ TurnAction
Returns a new instance of TurnAction.
91 92 93 94 |
# File 'lib/zyps/actions.rb', line 91 def initialize(rate, angle) super @angle = angle end |
Instance Attribute Details
#angle ⇒ Object
Angle to turn at.
90 91 92 |
# File 'lib/zyps/actions.rb', line 90 def angle @angle end |
Instance Method Details
#do(actor, targets) ⇒ Object
95 96 97 98 99 100 |
# File 'lib/zyps/actions.rb', line 95 def do(actor, targets) actor.vector += Vector.new( delta, actor.vector.pitch + @angle ) end |