feat: prepare badnics support
This commit is contained in:
parent
baa59db9c2
commit
fa4964a877
2 changed files with 24 additions and 0 deletions
|
@ -0,0 +1,6 @@
|
||||||
|
local Parent = require "game.modules.world.actors.ennemies.parent"
|
||||||
|
local Motobug = Parent:extend()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return Motobug
|
|
@ -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
|
Loading…
Reference in a new issue