Class: AGL::Block

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(x, y, w, h, passable) ⇒ Block

Returns a new instance of Block.



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

def initialize x, y, w, h, passable
	@x = x; @y = y; @w = w; @h = h
	@passable = passable
end

Instance Attribute Details

#hObject (readonly)

Returns the value of attribute h.



5
6
7
# File 'lib/minigl/movement.rb', line 5

def h
  @h
end

#passableObject (readonly)

Returns the value of attribute passable.



5
6
7
# File 'lib/minigl/movement.rb', line 5

def passable
  @passable
end

#wObject (readonly)

Returns the value of attribute w.



5
6
7
# File 'lib/minigl/movement.rb', line 5

def w
  @w
end

#xObject (readonly)

Returns the value of attribute x.



5
6
7
# File 'lib/minigl/movement.rb', line 5

def x
  @x
end

#yObject (readonly)

Returns the value of attribute y.



5
6
7
# File 'lib/minigl/movement.rb', line 5

def y
  @y
end

Instance Method Details

#boundsObject



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

def bounds
	Rectangle.new @x, @y, @w, @h
end