From aaf4181ba947d6bcdde88893f5ab9e023485eec1 Mon Sep 17 00:00:00 2001 From: LainLayer Date: Sun, 24 Mar 2024 23:21:58 +0300 Subject: test reducing turn duration relative to queue size --- eepers.adb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'eepers.adb') diff --git a/eepers.adb b/eepers.adb index 4e80714..5fc9079 100644 --- a/eepers.adb +++ b/eepers.adb @@ -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; @@ -1493,6 +1494,12 @@ begin Command_Enqueue(Command_Queue, (Kind => Command_Plant)); end if; end if; + 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; + Any_Key_Pressed := False; while not Any_Key_Pressed and then Get_Key_Pressed /= KEY_NULL loop Any_Key_Pressed := True; -- cgit v1.2.3 From a5d42d9b9c8fb113dbfb6ee29f9e36277b329e6c Mon Sep 17 00:00:00 2001 From: rexim Date: Mon, 25 Mar 2024 03:54:31 +0700 Subject: Reduce capacity of queue. Bump turn duration on sprint. --- eepers.adb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'eepers.adb') diff --git a/eepers.adb b/eepers.adb index 5fc9079..7237311 100644 --- a/eepers.adb +++ b/eepers.adb @@ -936,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; @@ -1494,10 +1494,14 @@ begin Command_Enqueue(Command_Queue, (Kind => Command_Plant)); end if; end if; - if Command_Queue.Size /= 0 then - TURN_DURATION_SECS := BASE_TURN_DURATION_SECS * (1.0 / Float(Command_Queue.Size)); + if Is_Key_Down(KEY_LEFT_SHIFT) then + TURN_DURATION_SECS := BASE_TURN_DURATION_SECS * 0.8; else - TURN_DURATION_SECS := BASE_TURN_DURATION_SECS; + 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; -- cgit v1.2.3