37 lines
844 B
Lua
37 lines
844 B
Lua
|
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()
|
||
|
print("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
|
||
|
self.controller.actormanager:switchActiveActor()
|
||
|
--self.controller.actormanager.turns.changeActor = false
|
||
|
self.isActive = false
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
|
||
|
function Actor:validateAction()
|
||
|
|
||
|
end
|
||
|
|
||
|
return Actor
|