modules/world: put the update functions in the baseactor
This commit is contained in:
parent
1d26588904
commit
187f0286df
2 changed files with 15 additions and 9 deletions
|
@ -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.
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue