32 if (input.IsMouseButtonPressed(GLFW_MOUSE_BUTTON_LEFT))
34 if (m_animationComponent && !m_animationComponent->
IsPlaying())
36 m_animationComponent->
Play(
"shoot",
false);
42 m_audioComponent->
Stop(
"shoot");
44 m_audioComponent->
Play(
"shoot");
52 glm::vec3 pos = glm::vec3(0.0f);
55 pos = child->GetWorldPosition();
57 bullet->SetPosition(pos +
m_rotation * glm::vec3(-0.2f, 0.2f, -1.75f));
59 auto collider = std::make_shared<eng::SphereCollider>(0.2f);
60 auto rigidBody = std::make_shared<eng::RigidBody>(
64 glm::vec3 front =
m_rotation * glm::vec3(0.0f, 0.0f, -1.0f);
65 rigidBody->ApplyImpulse(front * 500.0f);
69 if (input.IsKeyPressed(GLFW_KEY_SPACE))
71 if (m_audioComponent && !m_audioComponent->
IsPlaying(
"jump"))
73 m_audioComponent->
Play(
"jump");
78 input.IsKeyPressed(GLFW_KEY_W) ||
79 input.IsKeyPressed(GLFW_KEY_A) ||
80 input.IsKeyPressed(GLFW_KEY_S) ||
81 input.IsKeyPressed(GLFW_KEY_D);
83 if (walking && m_playerControllerComponent && m_playerControllerComponent->
OnGround())
85 if (m_audioComponent && !m_audioComponent->
IsPlaying(
"step"))
87 m_audioComponent->
Play(
"step",
true);
92 if (m_audioComponent && m_audioComponent->
IsPlaying(
"step"))
94 m_audioComponent->
Stop(
"step");