Browse Source

I came in and updated Wrecking Ball;

bjorn 3 years ago
parent
commit
b32b0a504c
1 changed files with 6 additions and 6 deletions
  1. 6 6
      examples/Physics/Wrecking_Ball/main.lua

+ 6 - 6
examples/Physics/Wrecking_Ball/main.lua

@@ -42,7 +42,7 @@ function lovr.load()
     even = not even
   end
 
-  lovr.graphics.setBackgroundColor(0.1, 0.1, 0.1)
+  lovr.graphics.setBackground(0.1, 0.1, 0.1)
 end
 
 
@@ -51,19 +51,19 @@ function lovr.update(dt)
 end
 
 
-function lovr.draw()
+function lovr.draw(pass)
   for i, collider in ipairs(world:getColliders()) do
     local shade = (i - 10) / #world:getColliders()
-    lovr.graphics.setColor(shade, shade, shade)
+    pass:setColor(shade, shade, shade)
     local shape = collider:getShapes()[1]
     local shapeType = shape:getType()
     local x,y,z, angle, ax,ay,az = collider:getPose()
     if shapeType == 'box' then
       local sx, sy, sz = shape:getDimensions()
-      lovr.graphics.box('fill', x,y,z, sx,sy,sz, angle, ax,ay,az)
+      pass:box(x,y,z, sx,sy,sz, angle, ax,ay,az)
     elseif shapeType == 'sphere' then
-      lovr.graphics.setColor(0.4, 0, 0)
-      lovr.graphics.sphere(x,y,z, shape:getRadius())
+      pass:setColor(0.4, 0, 0)
+      pass:sphere(x,y,z, shape:getRadius())
     end
   end
 end