Combat Mode is more reliable now, just one little glitch that it doesn't exit on the last enemy dying.

Zed A. Shaw 3 weeks ago
parent 232c994347
commit cfe56bbf99
  1. 2
      README.md
  2. 2
      events.hpp
  3. 19
      gui.cpp
  4. 1
      gui.hpp
  5. 2
      systems.cpp

@ -1,4 +1,4 @@
# The Artisinal Handcrafted Retro-Future "3D" Dungeon Crawler
# The Artisanal Handcrafted Retro-Future "3D" Dungeon Crawler
Welcome to my latest obsession, and turn based dungeon crawler in the style of old school raycasted
games like _Wizardry_, _Might and Magic_, _Ultima_, and similar games. The game uses SFML 3.x as

@ -3,7 +3,7 @@
namespace Events {
enum GUI {
START, COMBAT, LOOT, DEATH, STAIRS_UP, STAIRS_DOWN, TRAP,
COMBAT_START
COMBAT_START, NO_NEIGHBORS
};
struct Combat {

@ -99,9 +99,13 @@ namespace gui {
System::combat($level);
run_systems();
$rotation = -10.0f;
state(State::IDLE);
state(State::IN_COMBAT);
}
break;
case STOP_COMBAT:
dbc::log("Exiting ATTACKING STATE");
state(State::IDLE);
break;
default:
dbc::log(fmt::format("In ATTACKING state, unhandled event {}", (int)ev));
}
@ -161,6 +165,7 @@ namespace gui {
case CLOSE:
dbc::log("Nothing to close.");
break;
case STOP_COMBAT:
case TICK:
// do nothing
break;
@ -186,6 +191,9 @@ namespace gui {
$camera.plan_rotate($rayview, -1);
state(State::COMBAT_ROTATE);
break;
case STOP_COMBAT:
state(State::IDLE);
break;
case QUIT:
$window.close();
state(State::END);
@ -405,9 +413,12 @@ namespace gui {
}
}
break;
case eGUI::COMBAT_START: {
event(Event::START_COMBAT);
} break;
case eGUI::COMBAT_START:
event(Event::START_COMBAT);
break;
case eGUI::NO_NEIGHBORS:
event(Event::STOP_COMBAT);
break;
case eGUI::LOOT: {
// auto &item = std::any_cast<InventoryItem&>(data);
// $status_view.log(fmt::format("You picked up a {}.",

@ -36,6 +36,7 @@ namespace gui {
ROTATE_RIGHT,
ATTACK,
START_COMBAT,
STOP_COMBAT,
QUIT
};

@ -215,6 +215,8 @@ void System::collision(GameLevel &level) {
println("UNKNOWN COLLISION TYPE {}", entity);
}
}
} else {
world.send<Events::GUI>(Events::GUI::NO_NEIGHBORS, player.entity, player.entity);
}
}

Loading…
Cancel
Save