Class: Diamante::Scene::Space

Inherits:
Base
  • Object
show all
Defined in:
lib/diamante/scenes/space.rb

Defined Under Namespace

Classes: Star

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Space

Returns a new instance of Space.



10
11
12
13
14
# File 'lib/diamante/scenes/space.rb', line 10

def initialize(config)
  @config = config
  @chars_list = "-O "
  init
end

Instance Method Details

#initObject



16
17
18
19
# File 'lib/diamante/scenes/space.rb', line 16

def init
  @stars = []
  5.times { @stars << Star.new }
end

#renderObject



25
26
27
# File 'lib/diamante/scenes/space.rb', line 25

def render
  @stars.each { _1.update }
end

#updateObject



21
22
23
# File 'lib/diamante/scenes/space.rb', line 21

def update
  @stars.each { _1.render }
end