Class: Pacman::GameController

Inherits:
ApplicationController show all
Defined in:
app/controllers/game_controller.rb

Instance Method Summary collapse

Instance Method Details

#advanceObject



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

#showObject



16
17
18
# File 'app/controllers/game_controller.rb', line 16

def show
  render :show, world: world, palette: command_palette
end

#turn_downObject



31
# File 'app/controllers/game_controller.rb', line 31

def turn_down = turn(Arcade::Direction.down)

#turn_leftObject



33
# File 'app/controllers/game_controller.rb', line 33

def turn_left = turn(Arcade::Direction.left)

#turn_rightObject



35
# File 'app/controllers/game_controller.rb', line 35

def turn_right = turn(Arcade::Direction.right)

#turn_upObject



29
# File 'app/controllers/game_controller.rb', line 29

def turn_up = turn(Arcade::Direction.up)