From d1d7bf8d94cbe98d5e4a9ad6163a88a288fb1e12 Mon Sep 17 00:00:00 2001 From: "Zed A. Shaw" Date: Tue, 26 May 2026 11:06:58 -0400 Subject: [PATCH] Fix the rotation speed so it's calculated based on the rotation angle. --- src/constants.hpp | 4 +++- src/game/systems.cpp | 4 ++++ src/game/systems.hpp | 1 + src/graphics/raycaster.hpp | 4 ++-- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/constants.hpp b/src/constants.hpp index 312ad83..6881b41 100644 --- a/src/constants.hpp +++ b/src/constants.hpp @@ -74,7 +74,9 @@ constexpr int COMBAT_UI_HEIGHT = SCREEN_HEIGHT - RAY_VIEW_HEIGHT; constexpr int INITIAL_MAP_W = 21; constexpr int INITIAL_MAP_H = 21; -constexpr float DEFAULT_ROTATE=0.5f; +constexpr float DEFAULT_ROTATE=0.25f; +constexpr float DEFAULT_ROTATE_SPEED=DEFAULT_ROTATE / 2.0f; +constexpr float DEFAULT_MOVE_SPEED=0.1f; // for the panels/renderer constexpr wchar_t BG_TILE = L'█'; diff --git a/src/game/systems.cpp b/src/game/systems.cpp index 260b4db..4080f95 100644 --- a/src/game/systems.cpp +++ b/src/game/systems.cpp @@ -706,3 +706,7 @@ void System::init(Registry& reg) { reg.addUpdate(System::lighting); reg.addUpdate(System::death); } + +void System::restart() { + // TODO: implement starting a new game, duh +} diff --git a/src/game/systems.hpp b/src/game/systems.hpp index 5ed39d3..af15f06 100644 --- a/src/game/systems.hpp +++ b/src/game/systems.hpp @@ -72,4 +72,5 @@ namespace System { void clear_attack(); void spawn_attack(World& world, int attack_id, DinkyECS::Entity enemy); void init(Registry& reg); + void restart(); } diff --git a/src/graphics/raycaster.hpp b/src/graphics/raycaster.hpp index 922eda9..ad0c9a1 100644 --- a/src/graphics/raycaster.hpp +++ b/src/graphics/raycaster.hpp @@ -11,8 +11,8 @@ using RGBA = uint32_t; struct CameraLOL { double t = 0.0; - double move_speed = 0.1; - double rot_speed = 0.06; + double move_speed = DEFAULT_MOVE_SPEED; + double rot_speed = DEFAULT_ROTATE_SPEED; double target_x = 0.0; double target_y = 0.0; double target_dir_x = 0.0;