class Pitchcar::Pieces::Straight

Constants

IMAGE

Public Instance Methods

image() click to toggle source
# File lib/pieces/straight.rb, line 21
def image
  return IMAGE.rotate(90) if north? || south?
  IMAGE
end
next_coordinate() click to toggle source
# File lib/pieces/straight.rb, line 9
def next_coordinate
  if north?
    { x: x, y: y + 1 }
  elsif east?
    { x: x + 1, y: y }
  elsif west?
    { x: x - 1, y: y }
  elsif south?
    { x: x, y: y - 1 }
  end
end
next_direction() click to toggle source
# File lib/pieces/straight.rb, line 5
def next_direction
  direction
end
to_s() click to toggle source
# File lib/pieces/straight.rb, line 26
def to_s
  'S'
end