modules/world: put the update functions in the baseactor

This commit is contained in:
Kazhnuz 2019-05-05 21:04:00 +02:00
parent 1d26588904
commit 187f0286df
2 changed files with 15 additions and 9 deletions

View File

@ -59,15 +59,6 @@ function Actor2D:setBounceFactor(newBounceFactor)
self.bounceFactor = newBounceFactor or 0
end
-- UPDATE FUNCTIONS
-- Theses functions are activated every steps
function Actor2D:update(dt)
self:updateTimers(dt)
self:autoMove(dt)
self:updateSprite(dt)
end
-- MOVEMENT FUNCTIONS
-- Basic functions from the movement.

View File

@ -64,6 +64,21 @@ function BaseActor:destroy()
self.isDestroyed = true
end
-- UPDATE FUNCTIONS
-- Theses functions are activated every steps
function BaseActor:update(dt)
self:updateTimers(dt)
self:autoMove(dt)
self:updateSprite(dt)
end
function BaseActor:autoMove(dt)
-- The base actor don't have coordinate
-- so the autoMove is only usefull to its
-- 2D and 3D childrens
end
-- INPUT FUNCTIONS
-- get input from the world object