Skip to content
Snippets Groups Projects
Commit 5c2761ec authored by Nicolas Will's avatar Nicolas Will
Browse files

adding info of unit to cmdline output

parent 665df454
Branches
No related tags found
2 merge requests!29Merge main into box2d to implement physics,!20Level event handler
......@@ -335,6 +335,15 @@ void Level::handleMenuActiveEvents(Engine& engine, SDL_Event& event)
if (cmd == "Info")
{
// TODO: Hier Informationen zur Einheit darstellen
if (m_selectedUnit)
{
Unit& u = m_units.at(m_selectedUnit);
std::cout << "Health: " << u.m_health << std::endl;
}
}
if (cmd == "Train")
{
// hier Einheitenrekrutierung einsetzen
}
}
......@@ -360,6 +369,7 @@ void Level::handleMovementEvents(Engine& engine, SDL_Event& event)
case SDL_MOUSEBUTTONDOWN:
if (event.button.button == SDL_BUTTON_LEFT)
{
// Bei Movement animation in ANIMATING_STATE gehen
std::pair<int, int> tilePos = calcTilePos(event.button.x, event.button.y);
m_units.at(m_selectedUnit).updatePosition(tilePos.first, tilePos.second);
m_selectedUnit = -1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment