diff --git a/src/main.lua b/src/main.lua index b08fc82..e6c91fc 100644 --- a/src/main.lua +++ b/src/main.lua @@ -71,7 +71,7 @@ world:addEntity(floor) local scenarios = { default = function() world:addEntity(Cart.new()) - end , + end, manyCollectables = function() local cart = Cart.new() cart.velocity.x = 0 diff --git a/src/systems/draw.lua b/src/systems/draw.lua index a88a438..37e33be 100644 --- a/src/systems/draw.lua +++ b/src/systems/draw.lua @@ -8,16 +8,12 @@ drawRectanglesSystem = filteredSystem( end ) -drawSpriteSystem = filteredSystem( - "drawSprites", - { position = T.XyPair, drawAsSprite = T.pd_image }, - function(e) - if e.position.y < Camera.pan.y - 240 or e.position.y > Camera.pan.y + 480 then - return - end - e.drawAsSprite:draw(e.position.x, e.position.y) +drawSpriteSystem = filteredSystem("drawSprites", { position = T.XyPair, drawAsSprite = T.pd_image }, function(e) + if e.position.y < Camera.pan.y - 240 or e.position.y > Camera.pan.y + 480 then + return end -) + e.drawAsSprite:draw(e.position.x, e.position.y) +end) local xMargin = 4