summaryrefslogtreecommitdiffhomepage
path: root/cloud.lua
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2016-05-15 22:13:13 +0200
committerAki <nthirtyone@gmail.com>2016-05-15 22:13:13 +0200
commit8a51c55cfd5c22ff035f320c9128d6ec49009bf2 (patch)
treebae11d1bd59bf062e281a61e10eec26eb23295f6 /cloud.lua
parent25701ee54e8fbdcfd3a66fd1605f5b5b647e78a2 (diff)
downloadroflnauts-8a51c55cfd5c22ff035f320c9128d6ec49009bf2.zip
roflnauts-8a51c55cfd5c22ff035f320c9128d6ec49009bf2.tar.gz
roflnauts-8a51c55cfd5c22ff035f320c9128d6ec49009bf2.tar.bz2
ZU WARUDO!
Diffstat (limited to 'cloud.lua')
-rw-r--r--cloud.lua24
1 files changed, 21 insertions, 3 deletions
diff --git a/cloud.lua b/cloud.lua
index bb48eb6..04ee31b 100644
--- a/cloud.lua
+++ b/cloud.lua
@@ -7,15 +7,33 @@
Cloud = {
x = 0,
y = 0,
- sprite = love.graphics.newImage("assets/clouds.png")
+ t = 1, -- Type of the cloud (quad number)
+ sprite = love.graphics.newImage("assets/clouds.png"),
+ quads = {
+ [1] = love.graphics.newQuad( 1,159, 158,47, 480,49),
+ [2] = love.graphics.newQuad(161,319, 158,47, 480,49),
+ [3] = love.graphics.newQuad(321,479, 158,47, 480,49)
+ }
}
-- Constructor of `Cloud`
-function Cloud:new()
+function Cloud:new(x, y, t)
-- Meta
local o = {}
setmetatable(o, self)
self.__index = self
- -- Misc
+ -- Init
+ o.x = x or self.x
+ o.y = y or self.y
+ o.t = t or self.t
return o
+end
+
+-- Update of `Cloud`, returns x for world to delete cloud after reaching right corner
+function Cloud:update(dt)
+ return x
+end
+
+-- Draw `Cloud`
+function Cloud:draw()
end \ No newline at end of file