Class: Pacman::Player
- Inherits:
-
AnimatedObject
- Object
- AnimatedObject
- Pacman::Player
- Defined in:
- lib/pacman/player.rb
Overview
model class of pacman
Instance Attribute Summary collapse
-
#direction ⇒ Object
Returns the value of attribute direction.
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
Attributes inherited from AnimatedObject
Instance Method Summary collapse
-
#initialize(direction, x, y) ⇒ Player
constructor
A new instance of Player.
Constructor Details
#initialize(direction, x, y) ⇒ Player
Returns a new instance of Player.
4 5 6 7 8 |
# File 'lib/pacman/player.rb', line 4 def initialize(direction, x, y) super() @direction = direction @x, @y = x, y end |
Instance Attribute Details
#direction ⇒ Object
Returns the value of attribute direction.
10 11 12 |
# File 'lib/pacman/player.rb', line 10 def direction @direction end |
#x ⇒ Object
Returns the value of attribute x.
10 11 12 |
# File 'lib/pacman/player.rb', line 10 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
10 11 12 |
# File 'lib/pacman/player.rb', line 10 def y @y end |