Class: Pacman::GameController
- Inherits:
-
ApplicationController
- Object
- Charming::Controller
- ApplicationController
- Pacman::GameController
- Defined in:
- app/controllers/game_controller.rb
Instance Method Summary collapse
- #advance ⇒ Object
- #show ⇒ Object
- #turn_down ⇒ Object
- #turn_left ⇒ Object
- #turn_right ⇒ Object
- #turn_up ⇒ Object
Instance Method Details
#advance ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'app/controllers/game_controller.rb', line 20 def advance return unless movement_pulse? world.tick return finish_game if world.over? show end |
#show ⇒ Object
16 17 18 |
# File 'app/controllers/game_controller.rb', line 16 def show render :show, world: world, palette: command_palette end |
#turn_down ⇒ Object
31 |
# File 'app/controllers/game_controller.rb', line 31 def turn_down = turn(Arcade::Direction.down) |
#turn_left ⇒ Object
33 |
# File 'app/controllers/game_controller.rb', line 33 def turn_left = turn(Arcade::Direction.left) |