Class: SnakeGame::SnakePart
- Inherits:
-
GameObject
- Object
- GameObject
- SnakeGame::SnakePart
- Defined in:
- lib/snake_part.rb
Overview
Class representing a single part of snake
Instance Attribute Summary
Attributes inherited from GameObject
Instance Method Summary collapse
-
#initialize(position, image) ⇒ SnakePart
constructor
attr_accessor :position, :image.
Methods inherited from GameObject
Constructor Details
#initialize(position, image) ⇒ SnakePart
attr_accessor :position, :image
9 10 11 12 13 |
# File 'lib/snake_part.rb', line 9 def initialize(position, image) # @position = position # @image = image super position, image end |