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.



122
123
124
125
# File 'lib/zyps/environmental_factors.rb', line 122

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

Instance Attribute Details

#forceObject

Rate of acceleration.



120
121
122
# File 'lib/zyps/environmental_factors.rb', line 120

def force
  @force
end