From 8d51222d41a348867706ceaec80d36e017a8d7ab Mon Sep 17 00:00:00 2001 From: Aki Date: Fri, 13 May 2016 21:39:50 +0200 Subject: Scaling --- ground.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ground.lua') diff --git a/ground.lua b/ground.lua index 23b4dcf..d5fd46e 100644 --- a/ground.lua +++ b/ground.lua @@ -27,14 +27,14 @@ function Ground:new (world, x, y, shape, sprite) end -- Draw of `Ground` -function Ground:draw (offset_x, offset_y, debug) +function Ground:draw (offset_x, offset_y, scale, debug) -- defaults local offset_x = offset_x or 0 local offset_y = offset_y or 0 local debug = debug or false -- sprite draw love.graphics.setColor(255,255,255,255) - love.graphics.draw(self.sprite, self.body:getX()-math.ceil(self.sprite:getWidth()/2)+offset_x, self.body:getY()+offset_y) + love.graphics.draw(self.sprite, (self.body:getX()-math.ceil(self.sprite:getWidth()/2)+offset_x)*scale, (self.body:getY()+offset_y)*scale, 0, scale, scale) -- debug draw if debug then love.graphics.setColor(220, 220, 220, 100) -- cgit v1.1