feat: prepare badnics support

This commit is contained in:
Kazhnuz 2020-06-04 19:37:34 +02:00
parent baa59db9c2
commit fa4964a877
2 changed files with 24 additions and 0 deletions

View file

@ -0,0 +1,6 @@
local Parent = require "game.modules.world.actors.ennemies.parent"
local Motobug = Parent:extend()
return Motobug

View file

@ -0,0 +1,18 @@
local Parent = require "game.modules.world.actors.parent"
local EnnemyParent = Parent:extend()
function EnnemyParent:new(world, x, y, z, w, h, d)
EnnemyParent.super.new(self, world, "ennemy", x, y, z, w, h, d, true)
end
function EnnemyParent:getHurt(hp)
if (self.hp <= hp) then
self:die()
else
self.hp = self.hp - hp;
end
end
function EnnemyParent:die()
self:destroy()
end