Upd
This commit is contained in:
40
data/scripts/actors/actor_player.lua
Normal file
40
data/scripts/actors/actor_player.lua
Normal file
@@ -0,0 +1,40 @@
|
||||
-- базовый класс актора
|
||||
actor_base = inherit_table(game_object)
|
||||
|
||||
-- инициализация FSM
|
||||
|
||||
|
||||
function actor_base:on_init()
|
||||
game_object.on_init(self)
|
||||
end
|
||||
|
||||
function actor_base:on_shutdown()
|
||||
game_object.on_shutdown(self)
|
||||
end
|
||||
|
||||
function actor_base:on_update(dt)
|
||||
game_object.on_update(self, dt)
|
||||
end
|
||||
|
||||
-- игрок
|
||||
actor_player = inherit_table(actor_base)
|
||||
|
||||
function actor_player:on_init()
|
||||
actor_base.on_init(self)
|
||||
|
||||
self:create_body()
|
||||
|
||||
self:activate_camera()
|
||||
end
|
||||
|
||||
function actor_player:on_shutdown()
|
||||
actor_base.on_shutdown(self)
|
||||
end
|
||||
|
||||
function actor_player:on_update(dt)
|
||||
actor_base.on_update(self, dt)
|
||||
|
||||
self:update_camera_look()
|
||||
--self:update_camera_movement(dt)
|
||||
self:update_body_movement(dt)
|
||||
end
|
||||
Reference in New Issue
Block a user