diff --git a/fonts/DefaultFont.tres b/fonts/DefaultFont.tres new file mode 100644 index 0000000..0551163 --- /dev/null +++ b/fonts/DefaultFont.tres @@ -0,0 +1,7 @@ +[gd_resource type="DynamicFont" load_steps=2 format=2] + +[ext_resource path="res://fonts/Louis George Cafe Bold.ttf" type="DynamicFontData" id=1] + +[resource] +size = 36 +font_data = ExtResource( 1 ) diff --git a/fonts/License.txt b/fonts/License.txt new file mode 100644 index 0000000..23d8673 --- /dev/null +++ b/fonts/License.txt @@ -0,0 +1,5 @@ +This is a Sans serif basic font. It's a professional version which was complicated hand-made +and computer-generated graphics, and various revisions. After installing on the computer, +you can create posters, web graphics, game graphics, t-shirts, videos, signs, logos and more. +These fonts are 100% FREE for both personal and business usages. If you have any question, +please feel free to contact me. yiningchen23@gmail.com diff --git a/fonts/Louis George Cafe Bold Italic.ttf b/fonts/Louis George Cafe Bold Italic.ttf new file mode 100644 index 0000000..0ce83b5 Binary files /dev/null and b/fonts/Louis George Cafe Bold Italic.ttf differ diff --git a/fonts/Louis George Cafe Bold.ttf b/fonts/Louis George Cafe Bold.ttf new file mode 100644 index 0000000..f417d1e Binary files /dev/null and b/fonts/Louis George Cafe Bold.ttf differ diff --git a/fonts/Louis George Cafe Italic.ttf b/fonts/Louis George Cafe Italic.ttf new file mode 100644 index 0000000..af7242b Binary files /dev/null and b/fonts/Louis George Cafe Italic.ttf differ diff --git a/fonts/Louis George Cafe Light Italic.ttf b/fonts/Louis George Cafe Light Italic.ttf new file mode 100644 index 0000000..3028f2e Binary files /dev/null and b/fonts/Louis George Cafe Light Italic.ttf differ diff --git a/fonts/Louis George Cafe Light.ttf b/fonts/Louis George Cafe Light.ttf new file mode 100644 index 0000000..e467044 Binary files /dev/null and b/fonts/Louis George Cafe Light.ttf differ diff --git a/fonts/Louis George Cafe.ttf b/fonts/Louis George Cafe.ttf new file mode 100644 index 0000000..e31d5fd Binary files /dev/null and b/fonts/Louis George Cafe.ttf differ diff --git a/project.godot b/project.godot index 0077273..4005b3c 100644 --- a/project.godot +++ b/project.godot @@ -11,12 +11,26 @@ config_version=4 [application] config/name="godot-wordle" +run/main_scene="res://src/Main.tscn" config/icon="res://icon.png" +[display] + +window/size/width=640 +window/size/height=960 +window/handheld/orientation="portrait" +window/stretch/mode="2d" +window/stretch/aspect="keep" + +[gui] + +theme/custom_font="res://fonts/DefaultFont.tres" + [physics] common/enable_pause_aware_picking=true [rendering] +environment/default_clear_color=Color( 0.129412, 0.129412, 0.215686, 1 ) environment/default_environment="res://default_env.tres" diff --git a/src/Letter.tscn b/src/Letter.tscn new file mode 100644 index 0000000..8a25691 --- /dev/null +++ b/src/Letter.tscn @@ -0,0 +1,26 @@ +[gd_scene load_steps=3 format=2] + +[ext_resource path="res://fonts/Louis George Cafe Bold.ttf" type="DynamicFontData" id=1] + +[sub_resource type="DynamicFont" id=1] +size = 52 +font_data = ExtResource( 1 ) + +[node name="Letter" type="ColorRect"] +margin_right = 85.0 +margin_bottom = 85.0 +rect_min_size = Vector2( 85, 85 ) +color = Color( 0.0313726, 0.0313726, 0.0588235, 0.509804 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Label" type="Label" parent="."] +anchor_right = 1.0 +anchor_bottom = 1.0 +custom_fonts/font = SubResource( 1 ) +align = 1 +valign = 1 +__meta__ = { +"_edit_use_anchors_": false +} diff --git a/src/Main.gd b/src/Main.gd new file mode 100644 index 0000000..bf815a3 --- /dev/null +++ b/src/Main.gd @@ -0,0 +1,23 @@ +extends CenterContainer + + +const letter_count := 5 +const guess_count := 6 + +const Letter = preload("res://src/Letter.tscn") + +export var color_incorrect: Color = Color() +export var color_misplaced: Color = Color() +export var color_correct: Color = Color() + +# An array of arrays of the letter nodes +var letters := [] + +func _ready() -> void: + for _i in range(guess_count): + var letter_array := [] + for _j in range(letter_count): + var letter := Letter.instance() + letter_array.append(letter) + $V/LetterGrid.add_child(letter) + letters.append(letter_array) diff --git a/src/Main.tscn b/src/Main.tscn new file mode 100644 index 0000000..89be797 --- /dev/null +++ b/src/Main.tscn @@ -0,0 +1,62 @@ +[gd_scene load_steps=4 format=2] + +[ext_resource path="res://fonts/Louis George Cafe Bold.ttf" type="DynamicFontData" id=1] +[ext_resource path="res://src/Main.gd" type="Script" id=2] + +[sub_resource type="DynamicFont" id=1] +size = 72 +font_data = ExtResource( 1 ) + +[node name="Main" type="CenterContainer"] +anchor_right = 1.0 +anchor_bottom = 1.0 +script = ExtResource( 2 ) +__meta__ = { +"_edit_use_anchors_": false +} +color_incorrect = Color( 0.258824, 0.258824, 0.301961, 1 ) +color_misplaced = Color( 0.698039, 0.74902, 0, 1 ) +color_correct = Color( 0, 0.619608, 0.298039, 1 ) + +[node name="V" type="VBoxContainer" parent="."] +margin_left = 90.0 +margin_top = 393.0 +margin_right = 550.0 +margin_bottom = 566.0 +custom_constants/separation = 20 + +[node name="Title" type="Label" parent="V"] +margin_right = 460.0 +margin_bottom = 82.0 +custom_fonts/font = SubResource( 1 ) +text = "Godot Wordle" +align = 1 + +[node name="LetterGrid" type="GridContainer" parent="V"] +margin_left = 230.0 +margin_top = 102.0 +margin_right = 230.0 +margin_bottom = 102.0 +grow_horizontal = 2 +size_flags_horizontal = 4 +custom_constants/vseparation = 8 +custom_constants/hseparation = 8 +columns = 5 + +[node name="H" type="HBoxContainer" parent="V"] +margin_top = 122.0 +margin_right = 460.0 +margin_bottom = 173.0 +custom_constants/separation = 12 + +[node name="GuessText" type="LineEdit" parent="V/H"] +margin_right = 334.0 +margin_bottom = 51.0 +size_flags_horizontal = 3 +max_length = 5 + +[node name="GuessButton" type="Button" parent="V/H"] +margin_left = 346.0 +margin_right = 460.0 +margin_bottom = 51.0 +text = "Guess"