summaryrefslogtreecommitdiffhomepage
path: root/platform.lua
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2017-03-01 21:31:11 +0100
committerAki <nthirtyone@gmail.com>2017-03-01 21:33:23 +0100
commitbd22a09dc862ac5480426bfd5e0311a97b6cfa77 (patch)
tree971b467b2612a0b195a38ea5450b32399810c951 /platform.lua
parent55b0cf1a22e4a7e41fe00aa693445d6c4bd0652d (diff)
downloadroflnauts-bd22a09dc862ac5480426bfd5e0311a97b6cfa77.zip
roflnauts-bd22a09dc862ac5480426bfd5e0311a97b6cfa77.tar.gz
roflnauts-bd22a09dc862ac5480426bfd5e0311a97b6cfa77.tar.bz2
Rename: Animated -> Sprite
Rename: getSprite, setSprite -> getImage, setImage
Diffstat (limited to 'platform.lua')
-rw-r--r--platform.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/platform.lua b/platform.lua
index 908cf73..9d75e66 100644
--- a/platform.lua
+++ b/platform.lua
@@ -3,7 +3,7 @@
-- Collision category: [1]
-- WHOLE CODE HAS FLAG OF "need a cleanup"
-require "animated"
+require "sprite"
-- Metatable of `Platform`
-- nils initialized in constructor
@@ -14,7 +14,7 @@ Platform = {
world = nil,
}
Platform.__index = Platform
-setmetatable(Platform, Animated)
+setmetatable(Platform, Sprite)
-- Constructor of `Platform`
function Platform:new (game, world, x, y, shape, sprite, animations)
@@ -39,7 +39,7 @@ function Platform:new (game, world, x, y, shape, sprite, animations)
end
end
-- END HERE
- o:setSprite(love.graphics.newImage(sprite))
+ o:setImage(love.graphics.newImage(sprite))
o:setAnimationsList(animations)
o.world = game
return o
@@ -62,7 +62,7 @@ function Platform:draw (offset_x, offset_y, scale, debug)
local draw_x = (math.floor(x) + offset_x) * scale
local draw_y = (math.floor(y) + offset_y) * scale
-- sprite draw
- Animated.draw(self, draw_x, draw_y, 0, scale, scale)
+ Sprite.draw(self, draw_x, draw_y, 0, scale, scale)
-- debug draw
if debug then
love.graphics.setColor(255, 69, 0, 140)