diff --git a/sonic-bluestreak.love/game/modules/world/actors/ennemies/motobug.lua b/sonic-bluestreak.love/game/modules/world/actors/ennemies/motobug.lua new file mode 100644 index 0000000..618ca36 --- /dev/null +++ b/sonic-bluestreak.love/game/modules/world/actors/ennemies/motobug.lua @@ -0,0 +1,6 @@ +local Parent = require "game.modules.world.actors.ennemies.parent" +local Motobug = Parent:extend() + + + +return Motobug diff --git a/sonic-bluestreak.love/game/modules/world/actors/ennemies/parent.lua b/sonic-bluestreak.love/game/modules/world/actors/ennemies/parent.lua new file mode 100644 index 0000000..11347c0 --- /dev/null +++ b/sonic-bluestreak.love/game/modules/world/actors/ennemies/parent.lua @@ -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