X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;ds=sidebyside;f=src%2Fui%2Fui.cpp;h=ea9786b0382952c4aea69a5ac29b1cd0e7d8ed00;hb=955fbb45dedb570520fc45d2ce69f420bed2ad08;hp=c71b7c105a0f0c357a359e5cd8ac34779856d166;hpb=32909aa3224ec0ed5656721178eb6ad31cd047df;p=blank.git diff --git a/src/ui/ui.cpp b/src/ui/ui.cpp index c71b7c1..ea9786b 100644 --- a/src/ui/ui.cpp +++ b/src/ui/ui.cpp @@ -128,6 +128,10 @@ void Interface::HandlePress(const SDL_KeyboardEvent &event) { TurnBlock(); break; + case SDLK_n: + ToggleCollision(); + break; + case SDLK_b: PrintBlockInfo(); break; @@ -178,6 +182,11 @@ void Interface::TurnBlock() { hud.Display(selection); } +void Interface::ToggleCollision() { + ctrl.Controlled().WorldCollidable(!ctrl.Controlled().WorldCollidable()); + std::cout << "collision " << (ctrl.Controlled().WorldCollidable() ? "on" : "off") << std::endl; +} + void Interface::PrintBlockInfo() { std::cout << std::endl; if (!aim_chunk) {