summaryrefslogtreecommitdiffhomepage
path: root/not/PhysicalBody.lua
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2017-03-19 01:35:43 +0100
committerAki <nthirtyone@gmail.com>2017-03-19 01:35:43 +0100
commitb262cb3eec1a797832d168f9e6d144468fb48c1d (patch)
tree3bdc06329029d44f14515830afacee7410b69956 /not/PhysicalBody.lua
parent340a3a4b92de5495b47e8e1e102178edfd97514f (diff)
downloadroflnauts-b262cb3eec1a797832d168f9e6d144468fb48c1d.zip
roflnauts-b262cb3eec1a797832d168f9e6d144468fb48c1d.tar.gz
roflnauts-b262cb3eec1a797832d168f9e6d144468fb48c1d.tar.bz2
Initializers in PhysicalBody, Hero and Sprite
Diffstat (limited to 'not/PhysicalBody.lua')
-rw-r--r--not/PhysicalBody.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/not/PhysicalBody.lua b/not/PhysicalBody.lua
index 6e6a8a6..1f91faf 100644
--- a/not/PhysicalBody.lua
+++ b/not/PhysicalBody.lua
@@ -11,6 +11,12 @@ setmetatable(PhysicalBody, Sprite)
-- Constructor of `PhysicalBody`.
function PhysicalBody:new (world, x, y, imagePath)
- local o = Sprite:new(imagePath)
+ local o = setmetatable({}, self)
+ o:init(world, x, y, imagePath)
return o
+end
+
+-- Initializator of `PhysicalBody`.
+function PhysicalBody:init (world, x, y, imagePath)
+ Sprite.init(self, imagePath)
end \ No newline at end of file