sonic-radiance/sonic-radiance.love/scenes/battlesystem/entities/actor.lua

35 lines
788 B
Lua
Raw Normal View History

local Entity = require("scenes.battlesystem.entities.base")
local Actor = Entity:extend()
function Actor:new(controller, x, y, z)
Actor.super.new(self, controller, x, y, z)
self.isActor = true
self.speed = 3
self.isActive = false
self.debugActiveTimer = 0
end
function Actor:setActive()
2019-08-13 22:28:05 +02:00
core.debug:print("cbs/actor","actor " .. self.id .. " is active")
self.isActive = true
self.debugActiveTimer = 0
end
function Actor:update(dt)
if (self.isActive) then
self.debugActiveTimer = self.debugActiveTimer + dt
2019-08-13 22:28:05 +02:00
if self.debugActiveTimer >= 0.5 then
self.controller.actormanager:switchActiveActor()
--self.controller.actormanager.turns.changeActor = false
self.isActive = false
end
end
end
function Actor:validateAction()
end
return Actor