Module: SpaceInvaders::Mesurable
Instance Attribute Summary collapse
-
#x_position ⇒ Object
Returns the value of attribute x_position.
-
#y_position ⇒ Object
Returns the value of attribute y_position.
Instance Method Summary collapse
Instance Attribute Details
#x_position ⇒ Object
Returns the value of attribute x_position.
3 4 5 |
# File 'lib/space_invaders/behaviors/mesurable.rb', line 3 def x_position @x_position end |
#y_position ⇒ Object
Returns the value of attribute y_position.
3 4 5 |
# File 'lib/space_invaders/behaviors/mesurable.rb', line 3 def y_position @y_position end |
Instance Method Details
#height ⇒ Object
13 14 15 |
# File 'lib/space_invaders/behaviors/mesurable.rb', line 13 def height @image.height end |
#width ⇒ Object
9 10 11 |
# File 'lib/space_invaders/behaviors/mesurable.rb', line 9 def width @image.width end |
#x_middle ⇒ Object
5 6 7 |
# File 'lib/space_invaders/behaviors/mesurable.rb', line 5 def x_middle @x_position + @image.width/2 end |