Module: Tileable::InstanceMethods

Defined in:
lib/tileable.rb

Instance Method Summary collapse

Instance Method Details

#at?(x, y) ⇒ Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/tileable.rb', line 12

def at?(x,y)
  center == Processor.center_for(x, y)
end

#centerObject



16
17
18
# File 'lib/tileable.rb', line 16

def center
  [@center_x, @center_y]
end

#register!(x, y) ⇒ Object



7
8
9
10
# File 'lib/tileable.rb', line 7

def register!(x,y)
  @center_x, @center_y = *Processor.center_for(x, y)
  @top     = [@center_x - 24, @center_y - 24]
end

#top_xObject



20
21
22
# File 'lib/tileable.rb', line 20

def top_x
  @top.first
end

#top_yObject



24
25
26
# File 'lib/tileable.rb', line 24

def top_y
  @top.last
end