Class: Zyps::Gravity

Inherits:
Accelerator show all
Defined in:
lib/zyps/environmental_factors.rb

Overview

Gravity pulls all objects downward.

Instance Attribute Summary collapse

Attributes inherited from Accelerator

#vector

Instance Method Summary collapse

Methods inherited from Accelerator

#act

Constructor Details

#initialize(force = 9.8) ⇒ Gravity

Returns a new instance of Gravity.



168
169
170
171
# File 'lib/zyps/environmental_factors.rb', line 168

def initialize(force = 9.8)
	super(Vector.new(force, 90))
	self.force = force
end

Instance Attribute Details

#forceObject

Rate of acceleration.



166
167
168
# File 'lib/zyps/environmental_factors.rb', line 166

def force
  @force
end