Class: RubyArena::Game

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_arena/game.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Game

Returns a new instance of Game.



5
6
7
8
9
10
# File 'lib/ruby_arena/game.rb', line 5

def initialize(args)
  @arena = Arena.new
  @robot_files = args[:robot_files]
  @level = Level.new(args[:options][:level]) if args[:options][:level]
  add_robots_to_arena
end

Instance Attribute Details

#arenaObject (readonly)

Returns the value of attribute arena.



3
4
5
# File 'lib/ruby_arena/game.rb', line 3

def arena
  @arena
end

#levelObject (readonly)

Returns the value of attribute level.



3
4
5
# File 'lib/ruby_arena/game.rb', line 3

def level
  @level
end

Instance Method Details

#game_over?Boolean

Returns:



16
17
18
# File 'lib/ruby_arena/game.rb', line 16

def game_over?
  arena.game_over?
end

#runObject



12
13
14
# File 'lib/ruby_arena/game.rb', line 12

def run
  gui.show
end