From 861d6e0736346c4aa80c35d7f0b6f2841d64404f Mon Sep 17 00:00:00 2001 From: Aki Date: Sun, 15 May 2016 22:29:01 +0200 Subject: Draw & update --- cloud.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/cloud.lua b/cloud.lua index 04ee31b..d745ba7 100644 --- a/cloud.lua +++ b/cloud.lua @@ -31,9 +31,17 @@ end -- Update of `Cloud`, returns x for world to delete cloud after reaching right corner function Cloud:update(dt) - return x + self.x = self.x + 5*dt + return self.x end -- Draw `Cloud` -function Cloud:draw() +function Cloud:draw(offset_x, offset_y, scale) + -- defaults + local offset_x = offset_x or 0 + local offset_y = offset_y or 0 + local debug = debug or false + -- draw + love.graphics.setColor(255,255,255,255) + love.graphics.draw(self.sprite, self.quads[t], (self.x+offset_x)*scale, (self.y+offset_y)*scale, 0, scale, scale) end \ No newline at end of file -- cgit v1.1