sonic-bluestreak/sonic-bluestreak.love/game/modules/world/actors/ennemies/parent.lua

19 lines
394 B
Lua
Raw Normal View History

2020-06-04 19:37:34 +02:00
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