improvement(cbs): improve debugging
This commit is contained in:
parent
3a037e827d
commit
a8bd55a2c2
3 changed files with 5 additions and 7 deletions
|
@ -88,12 +88,12 @@ end
|
|||
function BattleArena:getObjectInCase(x, y)
|
||||
for i,v in ipairs(self.entities) do
|
||||
if (v.x == x) and (v.y == y) then
|
||||
print("one entity found in case " .. x .. ";" .. y)
|
||||
core.debug:print("cbs/battlearena", "one entity found in case <" .. x .. ";" .. y .. ">")
|
||||
return v
|
||||
end
|
||||
end
|
||||
|
||||
print("no entity found in case " .. x .. ";" .. y)
|
||||
--core.debug:print("cbs/battlearena", "no entity found in case " .. x .. ";" .. y)
|
||||
return nil
|
||||
end
|
||||
|
||||
|
|
|
@ -11,17 +11,15 @@ function Actor:new(controller, x, y, z)
|
|||
end
|
||||
|
||||
function Actor:setActive()
|
||||
print("actor " .. self.id .. " is active")
|
||||
core.debug:print("cbs/actor","actor " .. self.id .. " is active")
|
||||
self.isActive = true
|
||||
self.debugActiveTimer = 0
|
||||
print(self.debugActiveTimer)
|
||||
end
|
||||
|
||||
function Actor:update(dt)
|
||||
if (self.isActive) then
|
||||
self.debugActiveTimer = self.debugActiveTimer + dt
|
||||
print(math.floor(self.debugActiveTimer * 60))
|
||||
if self.debugActiveTimer >= 1 then
|
||||
if self.debugActiveTimer >= 0.5 then
|
||||
self.controller.actormanager:switchActiveActor()
|
||||
--self.controller.actormanager.turns.changeActor = false
|
||||
self.isActive = false
|
||||
|
|
|
@ -11,7 +11,7 @@ function Character:new(controller, x, y, charid)
|
|||
self.directionPrevious = 1
|
||||
|
||||
if charid == nil then
|
||||
err("FATAL ERROR: charid not set")
|
||||
core.debug:error("FATAL ERROR: charid not set")
|
||||
end
|
||||
self.charid = charid
|
||||
self.actionPerTurn = game.characters.list[self.charid].turns
|
||||
|
|
Loading…
Reference in a new issue