From 721174691381ad134f23178143965626c50ed117 Mon Sep 17 00:00:00 2001 From: ACKERMANNGUE <gawen.ackermann@hesge.ch> Date: Mon, 24 Mar 2025 13:54:51 +0100 Subject: [PATCH] ADD : text label to indicate how to rotate with UDP Sender --- impulse/Assets/Scripts/Logs/LogManager.cs | 3 +++ impulse/UDP_App/UDPsender.py | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/impulse/Assets/Scripts/Logs/LogManager.cs b/impulse/Assets/Scripts/Logs/LogManager.cs index f1e794b..f5822eb 100644 --- a/impulse/Assets/Scripts/Logs/LogManager.cs +++ b/impulse/Assets/Scripts/Logs/LogManager.cs @@ -135,6 +135,9 @@ public class LogManager : MonoBehaviour lastCollectibleTime = 0f; totalCollectibles = 0; currentScore = 0; + totalObstacles = 0; + lastObstacleHitTime = 0f; + obstaclesHitCount = 0; } [System.Serializable] diff --git a/impulse/UDP_App/UDPsender.py b/impulse/UDP_App/UDPsender.py index d6ca2a3..d4184ff 100644 --- a/impulse/UDP_App/UDPsender.py +++ b/impulse/UDP_App/UDPsender.py @@ -71,6 +71,13 @@ def draw_center_and_arrows(canvas): canvas.create_line(CENTER_CANVAS, CENTER_CANVAS + ARROW_MARGIN, CENTER_CANVAS, CENTER_CANVAS + ARROW_LENGTH, arrow=tk.LAST, width=2) canvas.create_line(CENTER_CANVAS - ARROW_MARGIN, CENTER_CANVAS, CENTER_CANVAS - ARROW_LENGTH, CENTER_CANVAS, arrow=tk.LAST, width=2) +def add_scroll_info_label(parent): + info_text = "Scroll ↑ : rotate right\nScroll ↓ : rotate left" + label_info = tk.Label(parent, text=info_text, + bg="white", fg="black", justify='right') + label_info.place(relx=1.0, x=-10, y=10, anchor='ne') + + def disable_tracking(event): global is_tracking is_tracking = False @@ -90,6 +97,7 @@ def main(): canvas.pack() draw_center_and_arrows(canvas) + add_scroll_info_label(root) root.bind('<Motion>', track_mouse) root.bind("<MouseWheel>", adjust_rotation) -- GitLab