Exploring raycasters and possibly make a little "doom like" game based on it.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
raycaster/main.cpp

42 lines
888 B

#include "gui_fsm.hpp"
#include "textures.hpp"
#include "sound.hpp"
#include "autowalker.hpp"
int main(int argc, char* argv[]) {
textures::init();
sound::init();
sound::mute(false);
gui::FSM main;
main.event(gui::Event::STARTED);
Autowalker walker(main);
sound::play("ambient_1", true);
if(argc > 1 && argv[1][0] == 't') {
walker.start_autowalk();
}
while(main.active()) {
main.render();
// ZED: need to sort out how to deal with this in the FSM
if(main.in_state(gui::State::IDLE)
|| main.in_state(gui::State::NEXT_LEVEL)
|| main.in_state(gui::State::MAPPING)
|| main.in_state(gui::State::IN_COMBAT))
{
if(main.autowalking) {
walker.autowalk();
} else {
main.keyboard_mouse();
}
} else{
main.event(gui::Event::TICK);
}
main.handle_world_events();
}
return 0;
}