Class: Pacman::Player

Inherits:
AnimatedObject show all
Defined in:
lib/pacman/player.rb

Overview

model class of pacman

Instance Attribute Summary collapse

Attributes inherited from AnimatedObject

#animation_index

Instance Method Summary collapse

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

#directionObject

Returns the value of attribute direction.



10
11
12
# File 'lib/pacman/player.rb', line 10

def direction
  @direction
end

#xObject

Returns the value of attribute x.



10
11
12
# File 'lib/pacman/player.rb', line 10

def x
  @x
end

#yObject

Returns the value of attribute y.



10
11
12
# File 'lib/pacman/player.rb', line 10

def y
  @y
end