sdl_runtime_compiler git · main
SDL3 game for running and compiling code at runtime
C++ 72.3% C 26.2%git clone https://git.christianimmanuel.de/sdl-graphics/sdl_runtime_compiler.gitwget https://git.christianimmanuel.de/sdl-graphics/sdl_runtime_compiler/archive/sdl_runtime_compiler.tar.gzRemap Drop to Q AND Add R to run program
src/levels/level_list.cpp | 4 ++-- src/states/game_state.cpp | 1 + src/systems/input_system.cpp | 3 ++- src/systems/input_system.hpp | 1 + 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/levels/level_list.cpp b/src/levels/level_list.cpp index e8b631a..d9ee3a0 100644 --- a/src/levels/level_list.cpp +++ b/src/levels/level_list.cpp @@ -133,8 +133,8 @@ They line up in the order you picked them.)", // ── Step 5: drop a word ────────────────────────────────────────── { - .hint = "Press R to drop the last word", - .details = R"(R drops the last word you picked. + .hint = "Press Q to drop the last word", + .details = R"(Q drops the last word you picked. The dropped word falls to the floor.)", .grants = {}, diff --git a/src/states/game_state.cpp b/src/states/game_state.cpp index 7e9483c..52345be 100644 --- a/src/states/game_state.cpp +++ b/src/states/game_state.cpp @@ -560,6 +560,7 @@ GameState::update(double dt) case InputCommand::Drop: on_DropLast(); break; case InputCommand::ShootAll: on_ShootAll(); break; case InputCommand::Compile: on_Compile(); break; + case InputCommand::Run: on_Run(); break; case InputCommand::DebugPrint: on_DebugPrint(); break; case InputCommand::FreelookStart: on_FreelookStart(); break; case InputCommand::FreelookEnd: on_FreelookEnd(); break; diff --git a/src/systems/input_system.cpp b/src/systems/input_system.cpp index 30213ab..1e0bc08 100644 --- a/src/systems/input_system.cpp +++ b/src/systems/input_system.cpp @@ -50,9 +50,10 @@ InputSystem::handle_Event(Game& game, const SDL_Event& e, FrameInput& input) case SDLK_F1: game.change_State(cpputils::make_unique<GameState>()); break; case SDLK_F2: input.commands.push_back(InputCommand::SandboxRestore);break; case SDLK_SPACE: input.commands.push_back(InputCommand::Jump); break; - case SDLK_R: input.commands.push_back(InputCommand::Drop); break; + case SDLK_Q: input.commands.push_back(InputCommand::Drop); break; case SDLK_F: input.commands.push_back(InputCommand::ShootAll); break; case SDLK_C: input.commands.push_back(InputCommand::Compile); break; + case SDLK_R: input.commands.push_back(InputCommand::Run); break; case SDLK_P: input.commands.push_back(InputCommand::DebugPrint); break; case SDLK_T: input.commands.push_back(InputCommand::TextStart); break; case SDLK_LSHIFT: diff --git a/src/systems/input_system.hpp b/src/systems/input_system.hpp index 87a7823..298b7e8 100644 --- a/src/systems/input_system.hpp +++ b/src/systems/input_system.hpp @@ -13,6 +13,7 @@ enum class InputCommand : uint8_t { Drop, ShootAll, Compile, + Run, DebugPrint, FreelookStart, FreelookEnd, NumberInc, NumberDec,