diff --git a/sonic-radiance.love/scenes/battlesystem/actors/battler.lua b/sonic-radiance.love/scenes/battlesystem/actors/battler.lua index c7a3f5e..31b43b7 100644 --- a/sonic-radiance.love/scenes/battlesystem/actors/battler.lua +++ b/sonic-radiance.love/scenes/battlesystem/actors/battler.lua @@ -1,7 +1,7 @@ local Parent = require("scenes.battlesystem.actors.parent") local Battler = Parent:extend() -function Battler:new(world, x, y, z) +function Battler:new(world, x, y, z, owner) Battler.super.new(self, world, x, y, z) self.start = {} @@ -14,6 +14,7 @@ function Battler:new(world, x, y, z) self.debugActiveTimer = 0 self.isSelected = false + self.owner = owner end function Battler:destroy() @@ -38,6 +39,13 @@ function Battler:update(dt) end end +function Battler:draw() + local x, y = self.world.map:gridToPixel(self.x, self.y, true) + love.graphics.setColor(1, 0, 0, 1) + love.graphics.rectangle("fill", x - 8, y - 32, 16, 32) + love.graphics.setColor(1, 1, 1, 1) +end + function Battler:validateAction() end diff --git a/sonic-radiance.love/scenes/battlesystem/actors/ennemy.lua b/sonic-radiance.love/scenes/battlesystem/actors/ennemy.lua index cd30f60..4732d80 100644 --- a/sonic-radiance.love/scenes/battlesystem/actors/ennemy.lua +++ b/sonic-radiance.love/scenes/battlesystem/actors/ennemy.lua @@ -4,18 +4,15 @@ local Ennemy = Battler:extend() local gui = require "game.modules.gui" function Ennemy:new(world, x, y, owner) - Ennemy.super.new(self, world, x, y, 0) + Ennemy.super.new(self, world, x, y, 0, owner) self.isEnnemy = true - self.owner = owner self.actionPerTurn = 2 end function Ennemy:draw() + Ennemy.super.draw(self) local x, y = self.world.map:gridToPixel(self.x, self.y, true) - love.graphics.setColor(1, 0, 0, 1) - love.graphics.rectangle("fill", x - 8, y - 32, 16, 32) - love.graphics.setColor(1, 1, 1, 1) self.owner:drawHUD(x - 14, y - 38) diff --git a/sonic-radiance.love/scenes/battlesystem/actors/hero.lua b/sonic-radiance.love/scenes/battlesystem/actors/hero.lua index 00ecd7c..eda167c 100644 --- a/sonic-radiance.love/scenes/battlesystem/actors/hero.lua +++ b/sonic-radiance.love/scenes/battlesystem/actors/hero.lua @@ -11,9 +11,8 @@ local ZGRAVITY = 0.2 -- Initialize the hero function Hero:new(world, x, y, owner, charnumber) - Hero.super.new(self, world, x, y, 0) + Hero.super.new(self, world, x, y, 0, owner) self.isHero = true - self.owner = owner self:initMovementSystem() diff --git a/sonic-radiance.love/scenes/battlesystem/actors/init.lua b/sonic-radiance.love/scenes/battlesystem/actors/init.lua index 5d7066d..262dafe 100644 --- a/sonic-radiance.love/scenes/battlesystem/actors/init.lua +++ b/sonic-radiance.love/scenes/battlesystem/actors/init.lua @@ -4,6 +4,7 @@ local baseURI = "scenes.battlesystem.actors." entities.Hero = require(baseURI .. "hero") entities.Ennemy = require(baseURI .. "ennemy") +entities.Battler = require(baseURI .. "battler") entities.GFX = require(baseURI .. "gfx") return entities