Class: Zyps::FaceAction
- Inherits:
-
Action
- Object
- Action
- Zyps::FaceAction
- Defined in:
- lib/zyps/actions.rb
Overview
Head toward a target.
Instance Method Summary collapse
-
#do(actor, targets) ⇒ Object
Set the actor’s heading to point directly at first target.
Instance Method Details
#do(actor, targets) ⇒ Object
Set the actor’s heading to point directly at first target.
68 69 70 71 |
# File 'lib/zyps/actions.rb', line 68 def do(actor, targets) return if targets.empty? actor.vector.pitch = Utility.find_angle(actor.location, targets[0].location) end |