From 4d3ccfdd00bdbcd144dd8d283e1d0d4e150bd9f1 Mon Sep 17 00:00:00 2001 From: Aki Date: Fri, 20 Jan 2017 13:09:32 +0100 Subject: Metatable of Animated for Decoration and Ground --- decoration.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'decoration.lua') diff --git a/decoration.lua b/decoration.lua index 9552b09..609983a 100644 --- a/decoration.lua +++ b/decoration.lua @@ -28,6 +28,5 @@ function Decoration:draw(offset_x, offset_y, scale) local draw_x = (math.floor(x) + offset_x) * scale local draw_y = (math.floor(y) + offset_y) * scale -- draw - love.graphics.setColor(255,255,255,255) - love.graphics.draw(self.sprite, draw_x, draw_y, 0, scale, scale) + Animated.draw(self, draw_x, draw_y, 0, scale, scale) end \ No newline at end of file -- cgit v1.1 From 444eaa53c31704186cf38dbadfab1a5f014b78b4 Mon Sep 17 00:00:00 2001 From: Aki Date: Fri, 20 Jan 2017 13:12:27 +0100 Subject: Decoration < Animated --- decoration.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'decoration.lua') diff --git a/decoration.lua b/decoration.lua index 609983a..3ca6f76 100644 --- a/decoration.lua +++ b/decoration.lua @@ -4,10 +4,11 @@ Decoration = { x = 0, y = 0 } +Decoration.__index = Decoration +setmetatable(Decoration, Animated) function Decoration:new(x, y, sprite) local o = {} setmetatable(o, self) - self.__index = self o.sprite = love.graphics.newImage(sprite) o:setPosition(x,y) return o -- cgit v1.1