This commit is contained in:
2026-03-05 15:20:18 +03:00
parent 70c3459703
commit f8f69d3b88
25 changed files with 261 additions and 31 deletions

View File

@@ -1,6 +1,8 @@
-- игрок
actor_player = inherit_table(actor_base)
actor_player.m_camera_offset_y = 0.5
function actor_player:on_init()
actor_base.on_init(self)
@@ -14,7 +16,7 @@ function actor_player:on_init()
self.m_weapon_entity_id = ent:get_id()
self.m_in_reload = false
--local ent2 = engine.get_entity_from_id(self.m_weapon_entity_id)
--console.print(ent2:get_classname())
end
@@ -35,14 +37,15 @@ function actor_player:on_update(dt)
if self:get_action() == ACTION_FIRE and self.m_in_reload == false then
ent:play_animation(ent:find_animation("shoot1"), ANIM_PLAYBACK_NONE)
engine.play_sound("data/sounds/weapons/ump45_shoot.wav")
end
if self:get_action() == ACTION_RELOAD and self.m_in_reload == false then
ent:play_animation(ent:find_animation("reload"), ANIM_PLAYBACK_NONE)
self.m_in_reload = true
engine.play_sound("data/sounds/weapons/ump45_reload.wav")
self.m_in_reload = true
end
if ent:get_current_animation() == ent:find_animation("shoot1") and
ent:get_current_animation_time() >= ent:get_animation_time(ent:find_animation("shoot1")) then
ent:play_animation(ent:find_animation("idle1"), ANIM_PLAYBACK_REPEAT)
@@ -61,7 +64,3 @@ end
function actor_player:on_collide(other)
console.print(string.format("actor_player:on_collide: %s", other:get_classname()))
end
function play_sound( filename, is_3d, posx, posy, posz )
-- body
end