Class: Pacman::Ghost
- Inherits:
-
AnimatedObject
- Object
- AnimatedObject
- Pacman::Ghost
- Defined in:
- lib/pacman/ghost.rb
Overview
model of ghost
Direct Known Subclasses
Instance Attribute Summary collapse
-
#direction ⇒ Object
Returns the value of attribute direction.
-
#stopped ⇒ Object
Returns the value of attribute stopped.
-
#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(x, y, direction) ⇒ Ghost
constructor
A new instance of Ghost.
Constructor Details
#initialize(x, y, direction) ⇒ Ghost
Returns a new instance of Ghost.
4 5 6 7 8 9 |
# File 'lib/pacman/ghost.rb', line 4 def initialize(x, y, direction) super() @x, @y = x, y @direction = direction @stopped = false # used for slow ghost end |
Instance Attribute Details
#direction ⇒ Object
Returns the value of attribute direction.
11 12 13 |
# File 'lib/pacman/ghost.rb', line 11 def direction @direction end |
#stopped ⇒ Object
Returns the value of attribute stopped.
11 12 13 |
# File 'lib/pacman/ghost.rb', line 11 def stopped @stopped end |
#x ⇒ Object
Returns the value of attribute x.
11 12 13 |
# File 'lib/pacman/ghost.rb', line 11 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
11 12 13 |
# File 'lib/pacman/ghost.rb', line 11 def y @y end |