lib/minigl/movement.rb in minigl-2.0.11 vs lib/minigl/movement.rb in minigl-2.0.12
- old
+ new
@@ -205,11 +205,12 @@
# A Vector with the horizontal and vertical components of a force that
# be applied in the next time +move+ is called.
attr_accessor :stored_forces
- attr_reader :prev_speed # :nodoc:
+ # A Vector containing the speed of the object in the previous frame.
+ attr_reader :prev_speed
# Returns the bounding box as a Rectangle.
def bounds
Rectangle.new @x, @y, @w, @h
end
@@ -263,10 +264,10 @@
w = @w + (@speed.x < 0 ? -@speed.x : @speed.x)
h = @h + (@speed.y < 0 ? -@speed.y : @speed.y)
move_bounds = Rectangle.new x, y, w, h
coll_list = []
obst.each do |o|
- coll_list << o if move_bounds.intersect? o.bounds
+ coll_list << o if o != self && move_bounds.intersect?(o.bounds)
end
ramps.each do |r|
r.check_can_collide move_bounds
end