]> git.localhorst.tv Git - blank.git/blobdiff - src/ui/ui.cpp
entity/world collision response
[blank.git] / src / ui / ui.cpp
index c71b7c105a0f0c357a359e5cd8ac34779856d166..ea9786b0382952c4aea69a5ac29b1cd0e7d8ed00 100644 (file)
@@ -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) {