Class: Bang::InitialFrame
Constant Summary collapse
- SPEEDRANGE =
(3..8)
- TIMETOLIVERANGE =
(5..15)
Instance Attribute Summary
Attributes inherited from BaseFrame
#last_frame, #particles, #speed, #time_to_live
Instance Method Summary collapse
- #alive? ⇒ Boolean
-
#initialize(origin) ⇒ InitialFrame
constructor
A new instance of InitialFrame.
Constructor Details
#initialize(origin) ⇒ InitialFrame
Returns a new instance of InitialFrame.
13 14 15 16 17 18 |
# File 'lib/bang.rb', line 13 def initialize origin @speed = SPEEDRANGE.any @time_to_live = TIMETOLIVERANGE.any @particles = Array.new(10, {x: origin[:x], y: origin[:y], z: origin[:z]}) @last_frame = self end |
Instance Method Details
#alive? ⇒ Boolean
20 21 22 |
# File 'lib/bang.rb', line 20 def alive? true end |