diff options
author | Alexey Kutepov <reximkut@gmail.com> | 2024-03-25 04:12:27 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-25 04:12:27 +0700 |
commit | 499aade65f8b2a8c0b0bb909880f23cc4ea0cdbd (patch) | |
tree | 91cc073873a1fd85a48f5382d7bad79486d3e47f | |
parent | 9320775cfa0b537f5eb5af3bd0ee749ca8584b69 (diff) | |
parent | a5d42d9b9c8fb113dbfb6ee29f9e36277b329e6c (diff) |
Merge pull request #15 from LainLayer/movement_testing
apply `* (1.0 / Command_Queue.Size)` to turn duration to make rapid movement feel less delayed
-rw-r--r-- | eepers.adb | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -143,7 +143,8 @@ procedure Eepers is Put_Line("WARNING: could not load colors from file " & File_Name & ": " & Exception_Message(E)); end; - TURN_DURATION_SECS : constant Float := 0.125; + BASE_TURN_DURATION_SECS : constant Float := 0.125; + TURN_DURATION_SECS : Float := BASE_TURN_DURATION_SECS; GUARD_ATTACK_COOLDOWN : constant Integer := 10; EEPER_EXPLOSION_DAMAGE : constant Float := 0.45; GUARD_TURN_REGENERATION : constant Float := 0.01; @@ -935,7 +936,7 @@ procedure Eepers is when Command_Plant => null; end case; end record; - Command_Capacity: constant Natural := 5; + Command_Capacity: constant Natural := 3; type Command_Array is array (0..Command_Capacity-1) of Command; type Command_Queue_Record is record Items: Command_Array; @@ -1493,6 +1494,16 @@ begin Command_Enqueue(Command_Queue, (Kind => Command_Plant)); end if; end if; + if Is_Key_Down(KEY_LEFT_SHIFT) then + TURN_DURATION_SECS := BASE_TURN_DURATION_SECS * 0.8; + else + if Command_Queue.Size /= 0 then + TURN_DURATION_SECS := BASE_TURN_DURATION_SECS * (1.0 / Float(Command_Queue.Size)); + else + TURN_DURATION_SECS := BASE_TURN_DURATION_SECS; + end if; + end if; + Any_Key_Pressed := False; while not Any_Key_Pressed and then Get_Key_Pressed /= KEY_NULL loop Any_Key_Pressed := True; |