summaryrefslogtreecommitdiffhomepage
path: root/cloud.lua
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2016-05-15 22:29:01 +0200
committerAki <nthirtyone@gmail.com>2016-05-15 22:29:01 +0200
commit861d6e0736346c4aa80c35d7f0b6f2841d64404f (patch)
tree356a4c427dda8706c8e693b942199b04cdbc973e /cloud.lua
parent22f19497805c0ee4f4e5cfb6606673a9983dc191 (diff)
downloadroflnauts-861d6e0736346c4aa80c35d7f0b6f2841d64404f.zip
roflnauts-861d6e0736346c4aa80c35d7f0b6f2841d64404f.tar.gz
roflnauts-861d6e0736346c4aa80c35d7f0b6f2841d64404f.tar.bz2
Draw & update
Diffstat (limited to 'cloud.lua')
-rw-r--r--cloud.lua12
1 files 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