This commit is contained in:
2018-12-12 09:02:33 -06:00
parent 5843a9b0ae
commit c142bd2392
6 changed files with 46 additions and 27 deletions

View File

@@ -108,15 +108,14 @@ eos
# Expensive AABB collision detection
ObjectManager.objects.each do |object|
ObjectManager.objects.each do |b|
next if b == object
next if object.is_a?(Terrain)
next if b.is_a?(Terrain)
next if object == b
next if object.is_a?(Terrain) || b.is_a?(Terrain)
if object.intersect(object, b)
object.debug_color = Color.new(1.0,0.0,0.0)
b.debug_color = Color.new(1.0,0.0,0.0)
# ObjectManager.objects.delete(object)
# ObjectManager.objects.delete(object) unless object.is_a?(Player)
# puts "#{object} is intersecting #{b}" if object.is_a?(Player)
else
object.debug_color = Color.new(0,1,0)