Class: MazeGame
- Inherits:
-
Game
show all
- Defined in:
- lib/my_own_maze/game/maze_game.rb
Instance Attribute Summary
Attributes inherited from Game
#level
Instance Method Summary
collapse
Methods inherited from Game
#initialize
Constructor Details
This class inherits a constructor from Game
Instance Method Details
#do(action) ⇒ Object
11
12
13
|
# File 'lib/my_own_maze/game/maze_game.rb', line 11
def do(action)
@operation.do(action)
end
|
#print_success ⇒ Object
15
16
17
18
|
# File 'lib/my_own_maze/game/maze_game.rb', line 15
def print_success
@operation.print_maze
@style.print_success(@maze.width/2, @maze.height/2)
end
|
#start ⇒ Object
3
4
5
|
# File 'lib/my_own_maze/game/maze_game.rb', line 3
def start
@operation.print_maze
end
|
#success? ⇒ Boolean
7
8
9
|
# File 'lib/my_own_maze/game/maze_game.rb', line 7
def success?
@rule.success?(@player.x, @player.y)
end
|