Module: MoveByCursor

Included in:
Actor
Defined in:
lib/fantasy/includes/move_by_cursors.rb

Instance Method Summary collapse

Instance Method Details

#move_with_cursors(down: nil, up: nil, left: nil, right: nil, jump: false) ⇒ Object

rubocop:disable Metrics/PerceivedComplexity



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/fantasy/includes/move_by_cursors.rb', line 5

def move_with_cursors(down: nil, up: nil, left: nil, right: nil, jump: false)
  if down.nil? && up.nil? && left.nil? && right.nil?
    down = true
    up = true
    left = true
    right = true
  end

  @move_with_cursors_down = down || false
  @move_with_cursors_up = up || false
  @move_with_cursors_left = left || false
  @move_with_cursors_right = right || false
  @move_with_cursors_jump = jump || false
end