Class: RbSnake::Actions::MoveSnake

Inherits:
Object
  • Object
show all
Defined in:
lib/rb_snake/actions/move_snake.rb

Class Method Summary collapse

Class Method Details

.call(state, window) ⇒ Object



7
8
9
10
11
12
13
14
15
16
# File 'lib/rb_snake/actions/move_snake.rb', line 7

def call(state, window)
  snake = state.snake
  current_direction = state.current_direction
  food = state.food
  grid = state.grid

  make_next_move(snake, current_direction, food, grid, state)

  window.render(state)
end