fix: some clean-up to help the choregraphy viewer

This commit is contained in:
Kazhnuz 2020-08-03 17:38:30 +02:00
parent 2509708067
commit f867cba68d
4 changed files with 13 additions and 8 deletions

View file

@ -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

View file

@ -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)

View file

@ -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()

View file

@ -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