Now if you pass a simple t as an arg it will do a fast autowalk at the start, mostly for testing.

master
Zed A. Shaw 2 weeks ago
parent 14a96d0b63
commit d03abba8e4
  1. 6
      gui_fsm.cpp
  2. 1
      gui_fsm.hpp
  3. 6
      main.cpp

@ -293,7 +293,7 @@ namespace gui {
$main_ui.debug(); $main_ui.debug();
break; break;
case KEY::O: case KEY::O:
$autowalking = true; start_autowalk(0.06);
default: default:
break; // ignored break; // ignored
} }
@ -510,4 +510,8 @@ namespace gui {
} }
} }
void FSM::start_autowalk(double rot_speed) {
$autowalking = true;
$main_ui.$camera.rot_speed = rot_speed;
}
} }

@ -60,6 +60,7 @@ namespace gui {
void event(Event ev); void event(Event ev);
void autowalk(); void autowalk();
void start_autowalk(double rot_speed);
void START(Event ); void START(Event );
void MOVING(Event ); void MOVING(Event );

@ -2,13 +2,17 @@
#include "textures.hpp" #include "textures.hpp"
#include "sound.hpp" #include "sound.hpp"
int main() { int main(int argc, char* argv[]) {
textures::init(); textures::init();
sound::init(); sound::init();
sound::mute(true); sound::mute(true);
gui::FSM main; gui::FSM main;
main.event(gui::Event::STARTED); main.event(gui::Event::STARTED);
if(argc > 1 && argv[1][0] == 't') {
main.start_autowalk(0.1);
}
while(main.active()) { while(main.active()) {
main.render(); main.render();

Loading…
Cancel
Save