Class: SolidTile

Inherits:
Object
  • Object
show all
Defined in:
lib/solid_tile.rb

Instance Method Summary collapse

Constructor Details

#initialize(x, y) ⇒ SolidTile

Returns a new instance of SolidTile.



3
4
5
6
7
# File 'lib/solid_tile.rb', line 3

def initialize(x,y)
  @x, @y = x, y
  @x_range = (@x...@x+Processor::TileSize)
  @y_range = (@y...@y+Processor::TileSize)
end

Instance Method Details

#at?(x, y) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/solid_tile.rb', line 9

def at?(x, y)
  @x_range.include?(x) && @y_range.include?(y)
end