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

Instance Method Summary collapse

Methods inherited from TimedAction

#copy, #delta, #initialize, #start, #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.



79
80
81
# File 'lib/zyps/actions.rb', line 79

def rate
  @rate
end

Instance Method Details

#do(actor, targets) ⇒ Object

Increase or decrease speed according to elapsed time.



81
82
83
# File 'lib/zyps/actions.rb', line 81

def do(actor, targets)
	actor.vector.speed += delta
end