From 28b29badb4cdffd03ecbf91b3cf9da1a45ecff52 Mon Sep 17 00:00:00 2001
From: DETROYAT Alexis <alexis.detroyat@inria.fr>
Date: Fri, 23 Jun 2023 12:09:22 +0200
Subject: [PATCH] Added a --speed [value] argument to agdbentures so the player
 can modify the player speed at will (default is 5/100)

---
 agdbentures | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/agdbentures b/agdbentures
index 2d4d9daa..5b1e9438 100755
--- a/agdbentures
+++ b/agdbentures
@@ -42,6 +42,7 @@ from code_window import (
 from utils import log
 from config import Config
 from language import Lang
+from graphic.constants import Anim
 
 
 if __name__ == "__main__":
@@ -106,6 +107,14 @@ if __name__ == "__main__":
         help="Input in the terminal is forwarded to gdb/inferior (default = True). Disable when using interactive debugging.",
     )
 
+    parser.add_argument(
+        "--speed",
+        "-s",
+        type=int,
+        default=5,
+        help="Adjust player movement speed (from 1 to 100), affecting the SPEED constant in lib/graphic/constants.py"
+    )
+
     args = parser.parse_args()
 
     Config.CONSOLE = args.console
@@ -153,6 +162,8 @@ if __name__ == "__main__":
     if args.dev:
         Config.dev_mode()
 
+    Anim.SPEED = args.speed/100
+
     window = MainWindow(code_window_cls)
 
     if args.level is None:
-- 
GitLab