Class: Zyps::Gravity
- Inherits:
-
Accelerator
- Object
- EnvironmentalFactor
- Accelerator
- Zyps::Gravity
- Defined in:
- lib/zyps/environmental_factors.rb
Overview
Gravity pulls all objects downward.
Instance Attribute Summary collapse
-
#force ⇒ Object
Rate of acceleration.
Attributes inherited from Accelerator
Instance Method Summary collapse
-
#initialize(force = 9.8) ⇒ Gravity
constructor
A new instance of Gravity.
Methods inherited from Accelerator
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
#force ⇒ Object
Rate of acceleration.
166 167 168 |
# File 'lib/zyps/environmental_factors.rb', line 166 def force @force end |