Class: Pitchcar::Pieces::Start
- Defined in:
- lib/pieces/start.rb
Constant Summary collapse
- IMAGE =
Magick::Image.read(File.('../images/start_tile.png', __FILE__))[0]
Constants inherited from Piece
Instance Attribute Summary
Attributes inherited from Piece
#direction, #type, #x, #y
Instance Method Summary collapse
Methods inherited from Straight
#next_coordinate, #next_direction
Methods inherited from Piece
#coordinate, first_from_string, #initialize, #name, #to_h, type_from_string
Constructor Details
This class inherits a constructor from Pitchcar::Pieces::Piece
Instance Method Details
#image ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/pieces/start.rb', line 6 def image if north? IMAGE.rotate(270) elsif east? IMAGE elsif west? IMAGE.rotate(180) elsif south? IMAGE.rotate(90) end end |
#to_s ⇒ Object
18 19 20 |
# File 'lib/pieces/start.rb', line 18 def to_s 'St' end |