From 0bafe2cabd5b72f6d4e37b3f12b276e0d8a56714 Mon Sep 17 00:00:00 2001 From: Tangent Date: Fri, 28 Nov 2025 17:16:26 -0700 Subject: [PATCH] player can move between orbits and free movement --- src/main.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main.lua b/src/main.lua index 5b0fd9d..18aa3d2 100644 --- a/src/main.lua +++ b/src/main.lua @@ -236,8 +236,14 @@ function love.update(dt) if player_ship.velocity_x == 0 and player_ship.velocity_y == 0 then player_ship.orbital_radius = player_ship.orbital_radius or math.sqrt(player_ship.position_x^2 + player_ship.position_y^2) - player_ship.rotation_offset = player_ship.rotation_offset or math.atan2(player_ship.position_y, player_ship.position_x) -- this will fail due to not being at timestep 0 - -- might be fixable by computing where the game thinks the player should be and then adjusting it by where they are + if not player_ship.rotation_offset then + -- TEMP still locked to core_object + local argument = game_time / player_ship.orbital_radius^1.337 * orbital_speed_constant * core_object.radar_size^2 + if (argument == math.huge) or (argument ~= argument) then + argument = 0 + end + player_ship.rotation_offset = math.atan2(player_ship.position_y, player_ship.position_x) - argument + end -- TEMP player_ship localed to core_object orbit local argument = game_time / player_ship.orbital_radius^1.337 * orbital_speed_constant * core_object.radar_size^2 + player_ship.rotation_offset