Class: Zyps::FaceAction

Inherits:
Action
  • Object
show all
Defined in:
lib/zyps/actions.rb

Overview

Head toward a target.

Instance Attribute Summary

Attributes inherited from Action

#started

Instance Method Summary collapse

Methods inherited from Action

#copy, #initialize, #start, #started?, #stop

Constructor Details

This class inherits a constructor from Zyps::Action

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