Bonne idée.

This commit is contained in:
MarcEricMartel
2023-12-06 13:23:33 -05:00
parent 3b0f9650d4
commit 1762043757
4 changed files with 32 additions and 20 deletions

View File

@@ -431,6 +431,8 @@ void Engine::DisplayHud(int timer) {
// HP Bar
float playerHp = m_player.GetHP();
if (playerHp < 0.)
playerHp == 0;
float facteurOmbrage = m_displayInfo ? 0.5f : 1.0f;
float hpBarWidthProportion = 0.25f;
@@ -720,11 +722,11 @@ void Engine::DisplayInfo(float elapsedTime, BlockType bloc) {
ss.str("");
fPosY -= charSize;
ss << " Block : ";
if (bloc == BTYPE_LAST)
ss << "Weapon";
else
ss << (int)bloc;
//ss << " Block : ";
//if (bloc == BTYPE_LAST)
// ss << "Weapon";
//else
// ss << (int)bloc;
PrintText(fPosX, fPosYJump, ss.str());
}
@@ -1341,10 +1343,6 @@ void Engine::Render(float elapsedTime) {
m_audio.Create3DAudioObj(m_scream, AUDIO_PATH "scream.wav", m_player.GetPOV(), m_player.GetVelocity(), false, 1.f);
fell = true;
}
else if (m_player.GetPosition().y < -20.f) {
m_player = Player(Vector3f(.5f, CHUNK_SIZE_Y + 1.8f, .5f)); // Respawn si le bonho- joueur tombe en bas du monde.
fell = false;
}
if (m_networkgame) { // Pour se gerer le paquet.
static bool has_synced = false;
@@ -1381,7 +1379,8 @@ void Engine::Render(float elapsedTime) {
}
if (cmod_acc >= 1000) {
cmod_acc -= 1000;
while (cmod_acc >= 1000)
cmod_acc -= 1000;
if (!m_chunkmod_manifest.empty()) {
ChunkMod* cmod = m_chunkmod_manifest.front();
m_chunkmod_manifest.pop_front();