Skip to content

Commit 499aade

Browse files
authored
Merge pull request #15 from LainLayer/movement_testing
apply `* (1.0 / Command_Queue.Size)` to turn duration to make rapid movement feel less delayed
2 parents 9320775 + a5d42d9 commit 499aade

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

eepers.adb

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ procedure Eepers is
143143
Put_Line("WARNING: could not load colors from file " & File_Name & ": " & Exception_Message(E));
144144
end;
145145

146-
TURN_DURATION_SECS : constant Float := 0.125;
146+
BASE_TURN_DURATION_SECS : constant Float := 0.125;
147+
TURN_DURATION_SECS : Float := BASE_TURN_DURATION_SECS;
147148
GUARD_ATTACK_COOLDOWN : constant Integer := 10;
148149
EEPER_EXPLOSION_DAMAGE : constant Float := 0.45;
149150
GUARD_TURN_REGENERATION : constant Float := 0.01;
@@ -935,7 +936,7 @@ procedure Eepers is
935936
when Command_Plant => null;
936937
end case;
937938
end record;
938-
Command_Capacity: constant Natural := 5;
939+
Command_Capacity: constant Natural := 3;
939940
type Command_Array is array (0..Command_Capacity-1) of Command;
940941
type Command_Queue_Record is record
941942
Items: Command_Array;
@@ -1493,6 +1494,16 @@ begin
14931494
Command_Enqueue(Command_Queue, (Kind => Command_Plant));
14941495
end if;
14951496
end if;
1497+
if Is_Key_Down(KEY_LEFT_SHIFT) then
1498+
TURN_DURATION_SECS := BASE_TURN_DURATION_SECS * 0.8;
1499+
else
1500+
if Command_Queue.Size /= 0 then
1501+
TURN_DURATION_SECS := BASE_TURN_DURATION_SECS * (1.0 / Float(Command_Queue.Size));
1502+
else
1503+
TURN_DURATION_SECS := BASE_TURN_DURATION_SECS;
1504+
end if;
1505+
end if;
1506+
14961507
Any_Key_Pressed := False;
14971508
while not Any_Key_Pressed and then Get_Key_Pressed /= KEY_NULL loop
14981509
Any_Key_Pressed := True;

0 commit comments

Comments
 (0)