diff --git a/SQCSim2021/engine.cpp b/SQCSim2021/engine.cpp index 7f24df8..7d3d913 100644 --- a/SQCSim2021/engine.cpp +++ b/SQCSim2021/engine.cpp @@ -193,8 +193,19 @@ void Engine::Render(float elapsedTime) { m_player.ApplyTransformation(skybox, false); // Version d'ApplyTransformation qui ne tient compte que de la rotation // (donc l'objet ne bouge pas relativement au joueur, ce qui est pratique pour une skybox!). + static BlockType bloc = 1; + + if (m_mouseWU) bloc++; + else if (m_mouseWD) bloc--; + if (bloc == BTYPE_LAST) + bloc = BTYPE_DIRT; + else if (bloc == BTYPE_AIR) + bloc = BTYPE_LAST - 1; + + m_mouseWU = m_mouseWD = false; + if (m_mouseL) - m_world.ChangeBlockAtCursor(BTYPE_DIRT, m_player, m_block); + m_world.ChangeBlockAtCursor(bloc, m_player, m_block); else if (m_mouseR) m_world.ChangeBlockAtCursor(BTYPE_AIR, m_player, m_block);