From fef0b9ef968bc521f1bc28f72d2476891f212988 Mon Sep 17 00:00:00 2001 From: Terry Hearst Date: Wed, 23 Feb 2022 20:36:35 -0500 Subject: [PATCH] Generate the same word for 24 hours --- src/Main.gd | 8 +++++++- src/Main.tscn | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Main.gd b/src/Main.gd index 9ee4530..7c37161 100644 --- a/src/Main.gd +++ b/src/Main.gd @@ -27,7 +27,13 @@ func _ready() -> void: $C/V/LetterGrid.add_child(letter) letters.append(letter_array) - target_word = Global.generate_word(letter_count) + var current_time := OS.get_datetime_from_unix_time(OS.get_unix_time()) + current_time["hour"] = 0 + current_time["minute"] = 0 + current_time["second"] = 0 + var current_day_unix_time := OS.get_unix_time_from_datetime(current_time) + + target_word = Global.generate_word(letter_count, current_day_unix_time) current_guess = 0 diff --git a/src/Main.tscn b/src/Main.tscn index 1984b16..4caf3e5 100644 --- a/src/Main.tscn +++ b/src/Main.tscn @@ -59,7 +59,7 @@ __meta__ = { margin_right = 500.0 margin_bottom = 82.0 custom_fonts/font = SubResource( 1 ) -text = "Gordle" +text = "Daily Gordle" align = 1 [node name="LetterGrid" type="GridContainer" parent="C/V"] @@ -90,6 +90,7 @@ margin_top = 32.0 margin_right = 500.0 margin_bottom = 83.0 rect_min_size = Vector2( 500, 0 ) +size_flags_horizontal = 4 custom_constants/separation = 12 [node name="GuessText" type="LineEdit" parent="C/V/V/H"]