Crosby, Still, Jump and Shoot

This commit is contained in:
MarcEricMartel 2023-12-07 12:48:48 -05:00
parent f0afdf828e
commit 4e0a9cea35
2 changed files with 7 additions and 7 deletions

View File

@ -146,7 +146,7 @@ Timestamp Connection::Run(World* world) {
out.states.jumping = player->GetIsAirborne(); //abs(player->GetVelocity().y) > .2f;
out.states.running = player->GetVelocity().Length() > .5f;
out.states.still = !out.states.running;
out.states.still = !out.states.running && !out.states.jumping;
out.states.hit = player->m_hit;
player->m_hit = false;

View File

@ -1287,15 +1287,15 @@ void Engine::Render(float elapsedTime) {
for (int b = 0; b < BULLET_UPDATES_PER_FRAME; ++b) {
if (m_bullets[x]->Update(&m_world, elapsedTime, BULLET_UPDATES_PER_FRAME, m_players, m_networkgame ? &m_chunkmod : nullptr)) {
m_bullets[x]->~Bullet();
if (m_whoosh[x])
m_whoosh[x]->drop();
m_bullets[x] = nullptr;
//if (m_whoosh[x])
// m_whoosh[x]->drop();
//m_bullets[x] = nullptr;
m_whoosh[x] = nullptr;
break;
}
else if (!m_whoosh[x]) {
m_whoosh[x] = m_audio.Create3DAudioObj(m_whoosh[x], AUDIO_PATH "noise.wav", m_bullets[x]->getPos(), m_bullets[x]->getVel(), true, (m_bullets[x]->getPos() - m_player.GetPosition()).Length());
}
// else if (!m_whoosh[x]) {
// m_whoosh[x] = m_audio.Create3DAudioObj(m_whoosh[x], AUDIO_PATH "noise.wav", m_bullets[x]->getPos(), m_bullets[x]->getVel(), true, (m_bullets[x]->getPos() - m_player.GetPosition()).Length());
// }
else {
Vector3f pos = m_bullets[x]->getPos(), vel = m_bullets[x]->getVel();
m_audio.Render3DAudioObj(m_whoosh[x], pos, vel, 5 - (m_bullets[x]->getPos() - m_player.GetPosition()).Length());