Class: Zyps::AccelerateAction

Inherits:
TimedAction show all
Defined in:
lib/zyps/actions.rb

Overview

Increase/decrease speed over time.

Instance Attribute Summary collapse

Attributes inherited from TimedAction

#clock

Attributes inherited from Action

#started

Instance Method Summary collapse

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

#rateObject

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