Class: Pacman::GhostsController
- Inherits:
-
Object
- Object
- Pacman::GhostsController
- Defined in:
- lib/pacman/ghosts_controller.rb
Overview
handles behaviour of ghosts
Instance Attribute Summary collapse
-
#colission ⇒ Object
Returns the value of attribute colission.
Instance Method Summary collapse
-
#initialize(level) ⇒ GhostsController
constructor
A new instance of GhostsController.
- #update ⇒ Object
Constructor Details
#initialize(level) ⇒ GhostsController
Returns a new instance of GhostsController.
4 5 6 7 |
# File 'lib/pacman/ghosts_controller.rb', line 4 def initialize(level) @level = level @colission = false end |
Instance Attribute Details
#colission ⇒ Object
Returns the value of attribute colission.
19 20 21 |
# File 'lib/pacman/ghosts_controller.rb', line 19 def colission @colission end |
Instance Method Details
#update ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/pacman/ghosts_controller.rb', line 9 def update @level.ghosts_frozen -= 1 unless (@level.ghosts_frozen == 0) return unless (@level.ghosts_frozen == 0) update_blinky || update_pinky || update_inky || update_clyde end |