Class: Game

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

Direct Known Subclasses

MazeGame

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(level = 1) ⇒ Game

Returns a new instance of Game.



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

def initialize(level = 1)
  @level = level
  set_config
  init_game
end

Instance Attribute Details

#levelObject

Returns the value of attribute level.



4
5
6
# File 'lib/my_own_maze/game.rb', line 4

def level
  @level
end

Instance Method Details

#do(action) ⇒ Object



20
21
22
# File 'lib/my_own_maze/game.rb', line 20

def do(action)
  raise "undefined do(#{action}) method"
end


24
25
26
# File 'lib/my_own_maze/game.rb', line 24

def print_success
  raise 'undefined print_success method'
end

#startObject



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

def start
  raise 'undefined start method'
end

#success?Boolean

Returns:

  • (Boolean)


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

def success?
  raise 'undefined success? method'
end