barre de vie
This commit is contained in:
@@ -131,6 +131,12 @@ void Engine::LoadResource() {
|
||||
|
||||
void Engine::UnloadResource() {}
|
||||
|
||||
void Engine::InstantDamage()
|
||||
{
|
||||
m_player.InflictDamage(m_player, 0.10f);
|
||||
m_damage = false;
|
||||
}
|
||||
|
||||
void Engine::SystemNotification(std::string systemLog) {
|
||||
std::string message = "";
|
||||
|
||||
@@ -536,7 +542,8 @@ void Engine::Render(float elapsedTime) {
|
||||
m_wrenderer.UpdateWorld(&m_world, m_player.GetPosition(), m_blockinfo);
|
||||
|
||||
if (m_isSkybox) m_skybox.Render(skybox);
|
||||
|
||||
if (m_damage)
|
||||
InstantDamage();
|
||||
ProcessNotificationQueue();
|
||||
DrawHud(elapsedTime, bloc);
|
||||
|
||||
@@ -604,6 +611,9 @@ void Engine::KeyPressEvent(unsigned char key) {
|
||||
break;
|
||||
case 8: // I - Ignorer
|
||||
break;
|
||||
case 9: // J - InstantDamage
|
||||
m_damage = true;
|
||||
break;
|
||||
case 17: // R - Ignorer
|
||||
break;
|
||||
case 19: // T - Ignorer
|
||||
|
@@ -43,6 +43,7 @@ private:
|
||||
|
||||
bool LoadTexture(Texture& texture, const std::string& filename, bool useMipmaps = true, bool stopOnError = true);
|
||||
|
||||
void InstantDamage();
|
||||
void SystemNotification(std::string systemLog);
|
||||
void KillNotification(Player killer, Player killed);
|
||||
void DisplayNotification(std::string message);
|
||||
@@ -83,6 +84,8 @@ private:
|
||||
int m_renderCount = 0;
|
||||
int m_countdown = COUNTDOWN;
|
||||
|
||||
bool m_damage = false;
|
||||
|
||||
bool m_wireframe = false;
|
||||
bool m_isSkybox = true;
|
||||
bool m_block = false;
|
||||
|
Reference in New Issue
Block a user