summaryrefslogtreecommitdiffhomepage
path: root/decoration.lua
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2017-04-09 22:07:04 +0200
committerAki <nthirtyone@gmail.com>2017-04-09 22:07:04 +0200
commit0dd01913fe0eefc7ba4bc0797877f40fdedf9315 (patch)
tree8d270eb07f589d2487b3ce66d4865e5a4718042a /decoration.lua
parent55b0cf1a22e4a7e41fe00aa693445d6c4bd0652d (diff)
parenta03c1125f10fbbad253a0efc4727072fcbd55345 (diff)
downloadroflnauts-0dd01913fe0eefc7ba4bc0797877f40fdedf9315.zip
roflnauts-0dd01913fe0eefc7ba4bc0797877f40fdedf9315.tar.gz
roflnauts-0dd01913fe0eefc7ba4bc0797877f40fdedf9315.tar.bz2
Merge branch 'com'
Diffstat (limited to 'decoration.lua')
-rw-r--r--decoration.lua33
1 files changed, 0 insertions, 33 deletions
diff --git a/decoration.lua b/decoration.lua
deleted file mode 100644
index 3ca6f76..0000000
--- a/decoration.lua
+++ /dev/null
@@ -1,33 +0,0 @@
-Decoration = {
- world = nil,
- sprite = nil,
- x = 0,
- y = 0
-}
-Decoration.__index = Decoration
-setmetatable(Decoration, Animated)
-function Decoration:new(x, y, sprite)
- local o = {}
- setmetatable(o, self)
- o.sprite = love.graphics.newImage(sprite)
- o:setPosition(x,y)
- return o
-end
-function Decoration:setPosition(x, y)
- self.x, self.y = x, y
-end
-function Decoration:getPosition()
- return self.x, self.y
-end
-function Decoration:draw(offset_x, offset_y, scale)
- -- locals
- local offset_x = offset_x or 0
- local offset_y = offset_y or 0
- local scale = scale or 1
- local x, y = self:getPosition()
- -- pixel grid
- local draw_x = (math.floor(x) + offset_x) * scale
- local draw_y = (math.floor(y) + offset_y) * scale
- -- draw
- Animated.draw(self, draw_x, draw_y, 0, scale, scale)
-end \ No newline at end of file