diff options
27 files changed, 540 insertions, 38 deletions
diff --git a/Assets/Fonts/Quicksand-Bold.ttf b/Assets/Fonts/Quicksand-Bold.ttf Binary files differnew file mode 100644 index 0000000..07d5127 --- /dev/null +++ b/Assets/Fonts/Quicksand-Bold.ttf diff --git a/Assets/Fonts/Quicksand-Bold.ttf.import b/Assets/Fonts/Quicksand-Bold.ttf.import new file mode 100644 index 0000000..8b414d9 --- /dev/null +++ b/Assets/Fonts/Quicksand-Bold.ttf.import @@ -0,0 +1,33 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://bhybdqwdcpywa" +path="res://.godot/imported/Quicksand-Bold.ttf-51a0763a43a05f6f07926cb3feff759f.fontdata" + +[deps] + +source_file="res://Assets/Fonts/Quicksand-Bold.ttf" +dest_files=["res://.godot/imported/Quicksand-Bold.ttf-51a0763a43a05f6f07926cb3feff759f.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/Assets/Fonts/Quicksand-SemiBold.ttf b/Assets/Fonts/Quicksand-SemiBold.ttf Binary files differnew file mode 100644 index 0000000..52059c3 --- /dev/null +++ b/Assets/Fonts/Quicksand-SemiBold.ttf diff --git a/Assets/Fonts/Quicksand-SemiBold.ttf.import b/Assets/Fonts/Quicksand-SemiBold.ttf.import new file mode 100644 index 0000000..7adcdff --- /dev/null +++ b/Assets/Fonts/Quicksand-SemiBold.ttf.import @@ -0,0 +1,33 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://df0pr57kqfmcr" +path="res://.godot/imported/Quicksand-SemiBold.ttf-292a87c2f6a0fd002c774d6634dd315a.fontdata" + +[deps] + +source_file="res://Assets/Fonts/Quicksand-SemiBold.ttf" +dest_files=["res://.godot/imported/Quicksand-SemiBold.ttf-292a87c2f6a0fd002c774d6634dd315a.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/Assets/Visuals/background.png b/Assets/Visuals/background.png Binary files differnew file mode 100644 index 0000000..845e1f0 --- /dev/null +++ b/Assets/Visuals/background.png diff --git a/Assets/Visuals/background.png.import b/Assets/Visuals/background.png.import new file mode 100644 index 0000000..d8aa757 --- /dev/null +++ b/Assets/Visuals/background.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://kaquqd3g4fyn" +path="res://.godot/imported/background.png-5bd59ef86010f24945bb7e74d4eff36a.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/Visuals/background.png" +dest_files=["res://.godot/imported/background.png-5bd59ef86010f24945bb7e74d4eff36a.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Assets/Visuals/blob0.png b/Assets/Visuals/blob0.png Binary files differnew file mode 100644 index 0000000..686222b --- /dev/null +++ b/Assets/Visuals/blob0.png diff --git a/Assets/Visuals/blob0.png.import b/Assets/Visuals/blob0.png.import new file mode 100644 index 0000000..1c1b3d1 --- /dev/null +++ b/Assets/Visuals/blob0.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cci7pus1kdxjj" +path="res://.godot/imported/blob0.png-8f167ee9c17cdce3ae635383bdf08f1a.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/Visuals/blob0.png" +dest_files=["res://.godot/imported/blob0.png-8f167ee9c17cdce3ae635383bdf08f1a.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Assets/Visuals/blob1.png b/Assets/Visuals/blob1.png Binary files differnew file mode 100644 index 0000000..45eab52 --- /dev/null +++ b/Assets/Visuals/blob1.png diff --git a/Assets/Visuals/blob1.png.import b/Assets/Visuals/blob1.png.import new file mode 100644 index 0000000..e9cc13f --- /dev/null +++ b/Assets/Visuals/blob1.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://hinhcem271jc" +path="res://.godot/imported/blob1.png-699c27ead26a5f775648b650674cee2a.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/Visuals/blob1.png" +dest_files=["res://.godot/imported/blob1.png-699c27ead26a5f775648b650674cee2a.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Assets/Visuals/blob2.png b/Assets/Visuals/blob2.png Binary files differnew file mode 100644 index 0000000..a0a4a00 --- /dev/null +++ b/Assets/Visuals/blob2.png diff --git a/Assets/Visuals/blob2.png.import b/Assets/Visuals/blob2.png.import new file mode 100644 index 0000000..3f74b6a --- /dev/null +++ b/Assets/Visuals/blob2.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://022ury5knnn" +path="res://.godot/imported/blob2.png-cf56db92199771ca7bf11d6d519f1fed.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/Visuals/blob2.png" +dest_files=["res://.godot/imported/blob2.png-cf56db92199771ca7bf11d6d519f1fed.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Assets/Visuals/circle.png b/Assets/Visuals/circle.png Binary files differnew file mode 100644 index 0000000..87b04ff --- /dev/null +++ b/Assets/Visuals/circle.png diff --git a/Assets/Visuals/circle.png.import b/Assets/Visuals/circle.png.import new file mode 100644 index 0000000..3da6d1f --- /dev/null +++ b/Assets/Visuals/circle.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://4kqj3gk42j8w" +path="res://.godot/imported/circle.png-fa3bc7d9aae7cae700730216509e4ebc.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/Visuals/circle.png" +dest_files=["res://.godot/imported/circle.png-fa3bc7d9aae7cae700730216509e4ebc.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Assets/Visuals/gradient.png b/Assets/Visuals/gradient.png Binary files differnew file mode 100644 index 0000000..9aa3967 --- /dev/null +++ b/Assets/Visuals/gradient.png diff --git a/Assets/Visuals/gradient.png.import b/Assets/Visuals/gradient.png.import new file mode 100644 index 0000000..83cdcf7 --- /dev/null +++ b/Assets/Visuals/gradient.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://doycr5vnquj23" +path="res://.godot/imported/gradient.png-f453bbb4051a6eb0380f55c6f71eb82c.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/Visuals/gradient.png" +dest_files=["res://.godot/imported/gradient.png-f453bbb4051a6eb0380f55c6f71eb82c.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Assets/Visuals/squircle.png b/Assets/Visuals/squircle.png Binary files differnew file mode 100644 index 0000000..8dbd8f9 --- /dev/null +++ b/Assets/Visuals/squircle.png diff --git a/Assets/Visuals/squircle.png.import b/Assets/Visuals/squircle.png.import new file mode 100644 index 0000000..6681085 --- /dev/null +++ b/Assets/Visuals/squircle.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cgirl46k2wyxe" +path="res://.godot/imported/squircle.png-a55c1cb5036e76ed83cb9a8fb33a7c6a.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/Visuals/squircle.png" +dest_files=["res://.godot/imported/squircle.png-a55c1cb5036e76ed83cb9a8fb33a7c6a.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Levels/IncreaseSize.gd b/Levels/IncreaseSize.gd index ed761ce..764a114 100644 --- a/Levels/IncreaseSize.gd +++ b/Levels/IncreaseSize.gd @@ -13,4 +13,7 @@ class_name IncreaseSize func _process(_delta): var scale = min_size + ((max_size - min_size) * ((max_value - (max_value - clampf(me.value, 0, max_value))) / max_value)) - me.scale = Vector2(scale, scale) + me.size = scale + + var range = min_range + ((max_range - min_range) * ((max_range - (max_range - clampf(me.value, 0, max_range))) / max_value)) + player.max_distance = range diff --git a/Levels/game.tscn b/Levels/game.tscn index c64175f..852378c 100644 --- a/Levels/game.tscn +++ b/Levels/game.tscn @@ -1,12 +1,18 @@ -[gd_scene load_steps=11 format=3 uid="uid://rd1m2fu22g1s"] +[gd_scene load_steps=17 format=3 uid="uid://rd1m2fu22g1s"] [ext_resource type="PackedScene" uid="uid://ccvoi0qmvlxmj" path="res://Reusable Scenes/number_node.tscn" id="1_j877y"] [ext_resource type="Script" path="res://Scripts/Generator.gd" id="1_uaslf"] [ext_resource type="Script" path="res://Scripts/Player.gd" id="3_j3fp5"] [ext_resource type="Script" path="res://Scripts/GameLoop.gd" id="3_u7xnc"] +[ext_resource type="FontFile" uid="uid://bhybdqwdcpywa" path="res://Assets/Fonts/Quicksand-Bold.ttf" id="4_5ifsc"] +[ext_resource type="FontFile" uid="uid://df0pr57kqfmcr" path="res://Assets/Fonts/Quicksand-SemiBold.ttf" id="4_cjrjl"] [ext_resource type="Script" path="res://Levels/IncreaseSize.gd" id="5_8xpc8"] [ext_resource type="Script" path="res://Scripts/ModifierLabel.gd" id="5_lj1b3"] [ext_resource type="Script" path="res://Scripts/AI.gd" id="6_ncui2"] +[ext_resource type="Texture2D" uid="uid://cci7pus1kdxjj" path="res://Assets/Visuals/blob0.png" id="8_esilc"] +[ext_resource type="Texture2D" uid="uid://hinhcem271jc" path="res://Assets/Visuals/blob1.png" id="8_u1qbb"] +[ext_resource type="Texture2D" uid="uid://022ury5knnn" path="res://Assets/Visuals/blob2.png" id="9_13brs"] +[ext_resource type="Texture2D" uid="uid://cgirl46k2wyxe" path="res://Assets/Visuals/squircle.png" id="13_8aorr"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_ludyn"] size = Vector2(38, 38) @@ -15,27 +21,31 @@ size = Vector2(38, 38) radius = 260.83 [sub_resource type="CircleShape2D" id="CircleShape2D_4p6y7"] -radius = 120.0 +radius = 160.0 [node name="MainNode2D" type="Node2D"] [node name="Generator" type="Node" parent="."] script = ExtResource("1_uaslf") numbernode = ExtResource("1_j877y") -min_nodes = 70 -max_nodes = 100 +min_nodes = 60 +max_nodes = 90 -[node name="GameLoop" type="Node" parent="." node_paths=PackedStringArray("label")] +[node name="GameLoop" type="Node" parent="." node_paths=PackedStringArray("label", "turn_label")] script = ExtResource("3_u7xnc") turns = 10 -label = NodePath("../Label") +label = NodePath("../Control/HBoxContainer/Label") +turn_label = NodePath("../Control/TurnLabel") level = "res://Levels/game.tscn" +[node name="BetweenPlayerAndAI" type="Timer" parent="GameLoop"] +one_shot = true + [node name="Player" parent="." instance=ExtResource("1_j877y")] z_index = 4096 position = Vector2(68, 661) do_scanning = false -color = Color(0, 0.329412, 0, 1) +color = Color(0.156863, 0.298039, 0.929412, 1) [node name="Player" type="Node" parent="Player" node_paths=PackedStringArray("line")] script = ExtResource("3_j3fp5") @@ -47,14 +57,18 @@ script = ExtResource("5_8xpc8") me = NodePath("..") player = NodePath("../Player") max_value = 100 -min_size = 1.0 -max_size = 2.0 +min_size = 0.08 +max_size = 0.2 +min_range = 160.0 +max_range = 350.0 [node name="Line2D" type="Line2D" parent="Player"] z_index = -1 +z_as_relative = false points = PackedVector2Array(0, 0, 0, 0) width = 20.0 -default_color = Color(0, 0, 0, 1) +default_color = Color(0.156863, 0.298039, 0.929412, 1) +texture_mode = 2 begin_cap_mode = 2 end_cap_mode = 2 @@ -79,6 +93,8 @@ offset_right = 31.0 offset_bottom = -36.0 grow_horizontal = 2 grow_vertical = 0 +theme_override_colors/font_color = Color(0, 0, 0, 1) +theme_override_fonts/font = ExtResource("4_5ifsc") text = "+ X" horizontal_alignment = 1 vertical_alignment = 1 @@ -90,7 +106,7 @@ wait_time = 2.0 [node name="AI" parent="." instance=ExtResource("1_j877y")] position = Vector2(1207, 52) do_scanning = false -color = Color(0.917647, 0, 0, 1) +color = Color(0.921569, 0.403922, 0.627451, 1) [node name="AI" type="Node" parent="AI" node_paths=PackedStringArray("shape_cast_original", "shape_cast_skill_issue")] script = ExtResource("6_ncui2") @@ -102,8 +118,10 @@ script = ExtResource("5_8xpc8") me = NodePath("..") player = NodePath("../AI") max_value = 100 -min_size = 1.0 -max_size = 2.0 +min_size = 0.08 +max_size = 0.2 +min_range = 160.0 +max_range = 340.0 [node name="ThisAIHasSkillIssue" type="ShapeCast2D" parent="AI"] modulate = Color(1, 0, 0, 1) @@ -130,6 +148,8 @@ offset_right = 31.0 offset_bottom = -36.0 grow_horizontal = 2 grow_vertical = 0 +theme_override_colors/font_color = Color(0, 0, 0, 1) +theme_override_fonts/font = ExtResource("4_5ifsc") text = "+ X" horizontal_alignment = 1 vertical_alignment = 1 @@ -144,11 +164,154 @@ position = Vector2(95, 551) [node name="NumberNode2" parent="." instance=ExtResource("1_j877y")] position = Vector2(1214, 127) -[node name="Label" type="Label" parent="."] -offset_right = 40.0 -offset_bottom = 23.0 -text = "Turns Left: X" +[node name="Blob0" type="Sprite2D" parent="."] +modulate = Color(0.615686, 0.792157, 1, 0.933333) +z_index = -999 +position = Vector2(252, 169) +texture = ExtResource("8_esilc") + +[node name="Blob2" type="Sprite2D" parent="."] +modulate = Color(0.72549, 0.639216, 0.858824, 0.631373) +z_index = -999 +position = Vector2(1051, 191) +scale = Vector2(0.866211, 0.779297) +texture = ExtResource("9_13brs") + +[node name="Blob1" type="Sprite2D" parent="."] +modulate = Color(0.839216, 0.623529, 1, 0.533333) +z_index = -999 +position = Vector2(702, 656) +texture = ExtResource("8_u1qbb") + +[node name="ColorRect" type="ColorRect" parent="."] +z_index = -1000 +custom_minimum_size = Vector2(1280, 720) +offset_right = 1280.0 +offset_bottom = 720.0 +mouse_filter = 1 +color = Color(0.835294, 0.956863, 1, 1) + +[node name="Control" type="Control" parent="."] +z_index = 4096 +layout_mode = 3 +anchors_preset = 0 +offset_right = 1280.0 +offset_bottom = 720.0 +mouse_filter = 1 + +[node name="HBoxContainer" type="HBoxContainer" parent="Control"] +layout_mode = 1 +anchors_preset = 10 +anchor_right = 1.0 +offset_bottom = 91.515 +grow_horizontal = 2 +alignment = 1 + +[node name="Label" type="Label" parent="Control/HBoxContainer"] +layout_mode = 2 +theme_override_colors/font_color = Color(1, 1, 1, 1) +theme_override_colors/font_outline_color = Color(0, 0, 0, 1) +theme_override_constants/outline_size = 13 +theme_override_fonts/font = ExtResource("4_5ifsc") +theme_override_font_sizes/font_size = 48 +text = "X" +horizontal_alignment = 1 +vertical_alignment = 2 + +[node name="Label2" type="Label" parent="Control/HBoxContainer"] +layout_mode = 2 +theme_override_colors/font_color = Color(0.835294, 0.835294, 0.835294, 1) +theme_override_colors/font_outline_color = Color(0, 0, 0, 1) +theme_override_constants/outline_size = 13 +theme_override_fonts/font = ExtResource("4_5ifsc") +theme_override_font_sizes/font_size = 22 +text = " turn(s) left" +horizontal_alignment = 1 +vertical_alignment = 2 + +[node name="TurnLabel" type="Label" parent="Control"] +layout_mode = 1 +anchors_preset = 10 +anchor_right = 1.0 +offset_top = 89.335 +offset_bottom = 117.335 +grow_horizontal = 2 +rotation = -0.0349066 +theme_override_colors/font_color = Color(1, 1, 1, 1) +theme_override_colors/font_outline_color = Color(0, 0, 0, 1) +theme_override_constants/outline_size = 8 +theme_override_fonts/font = ExtResource("4_cjrjl") +theme_override_font_sizes/font_size = 18 +text = "your turn!" +horizontal_alignment = 1 + +[node name="ResetLabel" type="Label" parent="Control"] +visible = false +layout_mode = 1 +anchors_preset = 3 +anchor_left = 1.0 +anchor_top = 1.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = -164.0 +offset_top = -62.0 +offset_right = -26.0 +offset_bottom = -34.0 +grow_horizontal = 0 +grow_vertical = 0 +rotation = 0.101229 +theme_override_colors/font_color = Color(0, 0, 0, 0.223529) +theme_override_colors/font_outline_color = Color(1, 1, 1, 0.317647) +theme_override_constants/outline_size = 7 +theme_override_fonts/font = ExtResource("4_5ifsc") +theme_override_font_sizes/font_size = 18 +text = "press R to reset" +horizontal_alignment = 1 + +[node name="Won" type="Control" parent="Control"] +visible = false +anchors_preset = 0 +offset_right = 1280.0 +offset_bottom = 720.0 + +[node name="TextureRect2" type="TextureRect" parent="Control/Won"] +modulate = Color(0.113725, 0.184314, 0.541176, 1) +layout_mode = 0 +offset_left = 400.0 +offset_top = 297.0 +offset_right = 1424.0 +offset_bottom = 809.0 +rotation = -0.170645 +scale = Vector2(0.42251, 0.392513) +texture = ExtResource("13_8aorr") + +[node name="TextureRect" type="TextureRect" parent="Control/Won"] +modulate = Color(0.172549, 0.419608, 1, 1) +layout_mode = 0 +offset_left = 435.0 +offset_top = 255.0 +offset_right = 1459.0 +offset_bottom = 767.0 +scale = Vector2(0.4, 0.4) +texture = ExtResource("13_8aorr") + +[node name="WonLabel" type="Label" parent="Control/Won"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_colors/font_color = Color(1, 1, 1, 1) +theme_override_colors/font_outline_color = Color(0.113725, 0.184314, 0.541176, 1) +theme_override_constants/outline_size = 15 +theme_override_fonts/font = ExtResource("4_cjrjl") +theme_override_font_sizes/font_size = 78 +text = "YOU won!" +horizontal_alignment = 1 +vertical_alignment = 1 +[connection signal="timeout" from="GameLoop/BetweenPlayerAndAI" to="GameLoop" method="_on_between_player_and_ai_timeout"] [connection signal="input_event" from="Player/PlayerArea2D" to="Player/Player" method="_on_player_area_2d_input_event"] [connection signal="timeout" from="Player/ModifierLabel/Timer" to="Player/ModifierLabel" method="_on_timer_timeout"] [connection signal="timeout" from="AI/ModifierLabel/Timer" to="AI/ModifierLabel" method="_on_timer_timeout"] diff --git a/Reusable Scenes/number_node.tscn b/Reusable Scenes/number_node.tscn index a10429b..37472df 100644 --- a/Reusable Scenes/number_node.tscn +++ b/Reusable Scenes/number_node.tscn @@ -1,8 +1,8 @@ [gd_scene load_steps=8 format=3 uid="uid://ccvoi0qmvlxmj"] [ext_resource type="Script" path="res://Scripts/NumberNode.gd" id="1_7p1bu"] -[ext_resource type="Texture2D" uid="uid://cckv0u0uvmp6p" path="res://icon.svg" id="2_d46p4"] [ext_resource type="Script" path="res://Scripts/NumberArea.gd" id="3_2viuw"] +[ext_resource type="Texture2D" uid="uid://4kqj3gk42j8w" path="res://Assets/Visuals/circle.png" id="3_bqdxd"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_ld6aj"] size = Vector2(66, 66) @@ -16,10 +16,11 @@ radius = 100.38 [sub_resource type="CircleShape2D" id="CircleShape2D_vk134"] radius = 120.0 -[node name="NumberNode" type="Node2D" node_paths=PackedStringArray("label", "sprite", "sprite_modifier")] +[node name="NumberNode" type="Node2D" node_paths=PackedStringArray("label", "sprite", "shadow_sprite", "sprite_modifier")] script = ExtResource("1_7p1bu") label = NodePath("Label") sprite = NodePath("Sprite2D") +shadow_sprite = NodePath("SpriteShadow") sprite_modifier = NodePath("Sprite2D2") [node name="NumberArea2D" type="Area2D" parent="."] @@ -46,16 +47,24 @@ shape = SubResource("CircleShape2D_vk134") target_position = Vector2(0, 0) collide_with_areas = true +[node name="SpriteShadow" type="Sprite2D" parent="."] +modulate = Color(0, 0, 0, 0.564706) +z_index = -2 +z_as_relative = false +position = Vector2(-5, 5) +scale = Vector2(0.08, 0.08) +texture = ExtResource("3_bqdxd") + [node name="Sprite2D" type="Sprite2D" parent="."] modulate = Color(0, 0, 0, 1) -scale = Vector2(0.3, 0.3) -texture = ExtResource("2_d46p4") +scale = Vector2(0.08, 0.08) +texture = ExtResource("3_bqdxd") [node name="Sprite2D2" type="Sprite2D" parent="."] modulate = Color(1, 0, 0, 1) position = Vector2(16, -17) -scale = Vector2(0.109375, 0.11) -texture = ExtResource("2_d46p4") +scale = Vector2(0.02, 0.02) +texture = ExtResource("3_bqdxd") [node name="Label" type="Label" parent="."] anchors_preset = 8 diff --git a/Scripts/AI.gd b/Scripts/AI.gd index 1428c06..886bb30 100644 --- a/Scripts/AI.gd +++ b/Scripts/AI.gd @@ -11,6 +11,9 @@ class_name AI func _ready(): GlobalVariables.ai = self +func _process(_delta): + shape_cast_original.shape.radius = max_distance + func step(alternative : bool = false): var shape_cast : ShapeCast2D @@ -37,5 +40,6 @@ func step(alternative : bool = false): else: if !alternative: step(true) + print("i have skill issue") else: print("i am softlocked!") diff --git a/Scripts/GameLoop.gd b/Scripts/GameLoop.gd index e5cf08e..6b71faf 100644 --- a/Scripts/GameLoop.gd +++ b/Scripts/GameLoop.gd @@ -3,7 +3,9 @@ class_name GameLoop @export var turns : int @export var label : Label +@export var turn_label : Label @export_file var level : String +@export var can_play : bool = true var current_turns : int = 0 var prev_turn : int = -1 @@ -14,13 +16,19 @@ func _ready(): current_turns = 0 func _process(_delta): - if current_turns >= turns: - label.text = "FINISHED!" - if prev_turn != current_turns: prev_turn = current_turns - label.text = "Turns Left: " + str(turns - current_turns) - if current_turns != 0: GlobalVariables.ai.step() + label.text = str(turns - current_turns) + if current_turns != 0: + can_play = false + turn_label.text = "ai's turn..." + $"BetweenPlayerAndAI".start() if Input.is_action_just_pressed("reset"): get_tree().change_scene_to_file(level) + +func _on_between_player_and_ai_timeout(): + GlobalVariables.ai.step() + can_play = true + if current_turns < turns: turn_label.text = "your turn!" + else: turn_label.text = "" diff --git a/Scripts/Generator.gd b/Scripts/Generator.gd index 834e07b..78ffa2f 100644 --- a/Scripts/Generator.gd +++ b/Scripts/Generator.gd @@ -36,7 +36,7 @@ func generate(): if is_big: new.position = Vector2(randf_range(400, 900), randf_range(200, 400)) # disgusting hardcoded values, or not really? else: - new.position = Vector2(randf_range(30, 1250), randf_range(30, 690)) + new.position = Vector2(randf_range(30, 1250), randf_range(90, 690)) get_node(GlobalVariables.NODE).add_child(new) diff --git a/Scripts/NumberNode.gd b/Scripts/NumberNode.gd index b566781..016a83c 100644 --- a/Scripts/NumberNode.gd +++ b/Scripts/NumberNode.gd @@ -19,17 +19,27 @@ enum Operations { @export_subgroup("Visual Nodes") @export var label : Label @export var sprite : Sprite2D +@export var shadow_sprite : Sprite2D @export var sprite_modifier : Sprite2D @export_subgroup("Visual Values") @export var color : Color = Color.BLACK @export var min_scale : float @export var max_scale : float +@export var target_pos : Vector2 + +var size : float = 1 func _ready(): + size = sprite.scale.x + target_pos = position update_visuals() func _process(_delta): - pass + sprite.scale = Vector2(size, size) + shadow_sprite.scale = sprite.scale + +func _physics_process(_delta): + position = position.lerp(target_pos, 0.2) func join_from(node : NumberNode): node.value += self.value @@ -49,7 +59,7 @@ func join_from(node : NumberNode): node.value = roundi(float(node.value) / float(self.modifier)) if modifier_label: modifier_label.pop("/ " + str(self.modifier)) - node.position = self.position + node.target_pos = self.position node.update_visuals() queue_free() diff --git a/Scripts/Player.gd b/Scripts/Player.gd index f3b9667..a7b398a 100644 --- a/Scripts/Player.gd +++ b/Scripts/Player.gd @@ -13,7 +13,8 @@ func _ready(): gameloop = GlobalVariables.gameloop func _input(event): - if GlobalVariables.is_snapping: + if GlobalVariables.is_snapping && gameloop.can_play && gameloop.current_turns < gameloop.turns: + line.visible = true var target_pos = (line.global_position - get_viewport().get_mouse_position()) var dist = sqrt(abs(target_pos.x) * abs(target_pos.x) + abs(target_pos.y) * abs(target_pos.y)) @@ -27,17 +28,17 @@ func _input(event): if event is InputEventMouseButton && !event.pressed: GlobalVariables.is_snapping = false + line.points[1] = Vector2.ZERO + line.visible = false - if target != null && gameloop.current_turns < gameloop.turns: + if target != null && gameloop.can_play && gameloop.current_turns < gameloop.turns: target.join_from($"..") gameloop.current_turns += 1 - - line.points[1] = Vector2.ZERO if target != null: line.rotation = 0 line.points[1] = -(line.global_position - target.global_position) func _on_player_area_2d_input_event(_viewport : Node, event : InputEvent, _shape_idx : int): - if event is InputEventMouseButton && event.pressed: + if event is InputEventMouseButton && event.pressed && gameloop.can_play && gameloop.current_turns < gameloop.turns: GlobalVariables.is_snapping = true diff --git a/icon.svg.import b/icon.svg.import index 7e09902..b676c5f 100644 --- a/icon.svg.import +++ b/icon.svg.import @@ -32,6 +32,6 @@ process/hdr_as_srgb=false process/hdr_clamp_exposure=false process/size_limit=0 detect_3d/compress_to=1 -svg/scale=1.0 +svg/scale=5.0 editor/scale_with_editor_scale=false editor/convert_colors_with_editor_theme=false |