summaryrefslogtreecommitdiffhomepage
path: root/not/Decoration.lua
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2017-08-13 02:26:55 +0200
committerAki <nthirtyone@gmail.com>2017-08-13 02:26:55 +0200
commitb1cf14d64a2d3e28683db87190c4b2c7799c259d (patch)
treee45dac5cc6ce5265e3e3e2c914eb7cc92a820b8b /not/Decoration.lua
parent0dd01913fe0eefc7ba4bc0797877f40fdedf9315 (diff)
parented62b573417bdc85bec616f6016846b02de4c906 (diff)
downloadroflnauts-b1cf14d64a2d3e28683db87190c4b2c7799c259d.zip
roflnauts-b1cf14d64a2d3e28683db87190c4b2c7799c259d.tar.gz
roflnauts-b1cf14d64a2d3e28683db87190c4b2c7799c259d.tar.bz2
Merge branch 'multi'maps
Diffstat (limited to 'not/Decoration.lua')
-rw-r--r--not/Decoration.lua29
1 files changed, 10 insertions, 19 deletions
diff --git a/not/Decoration.lua b/not/Decoration.lua
index 9dc2bdd..97524f5 100644
--- a/not/Decoration.lua
+++ b/not/Decoration.lua
@@ -1,26 +1,15 @@
+require "not.Entity"
+
--- `Decoration`
-- Positioned sprite used to decorate maps with additional graphics.
-Decoration = {
- world = --[[not.World]]nil,
- x = 0,
- y = 0
-}
+Decoration = Entity:extends()
--- `Decoration` is a child of `Sprite`.
-require "not.Sprite"
-Decoration.__index = Decoration
-setmetatable(Decoration, Sprite)
+Decoration.x = 0
+Decoration.y = 0
-- Constructor of `Decoration`.
-function Decoration:new (x, y, imagePath)
- local o = setmetatable({}, self)
- o:init(x, y, imagePath)
- return o
-end
-
--- Initializer of `Decoration`.
-function Decoration:init (x, y, imagePath)
- Sprite.init(self, imagePath)
+function Decoration:new (x, y, world, imagePath)
+ Decoration.__super.new(self, world, imagePath)
self:setPosition(x, y)
end
@@ -30,4 +19,6 @@ function Decoration:getPosition ()
end
function Decoration:setPosition (x, y)
self.x, self.y = x, y
-end \ No newline at end of file
+end
+
+return Decoration