diff options
-rw-r--r-- | Assets/Audio/lose.wav | bin | 0 -> 73206 bytes | |||
-rw-r--r-- | Assets/Audio/lose.wav.import | 24 | ||||
-rw-r--r-- | Assets/Audio/ouch.wav | bin | 0 -> 37072 bytes | |||
-rw-r--r-- | Assets/Audio/ouch.wav.import | 24 | ||||
-rw-r--r-- | Assets/Audio/score.wav | bin | 0 -> 35302 bytes | |||
-rw-r--r-- | Assets/Audio/score.wav.import | 24 | ||||
-rw-r--r-- | Assets/Audio/win.wav | bin | 0 -> 73206 bytes | |||
-rw-r--r-- | Assets/Audio/win.wav.import | 24 | ||||
-rw-r--r-- | Assets/Visuals/hole.png | bin | 0 -> 23840 bytes | |||
-rw-r--r-- | Assets/Visuals/hole.png.import | 34 | ||||
-rw-r--r-- | Levels/game.tscn | 467 | ||||
-rw-r--r-- | Reusable Scenes/number_node.tscn | 10 | ||||
-rw-r--r-- | Scripts/GameLoop.gd | 25 | ||||
-rw-r--r-- | Scripts/GlobalVariables.gd | 1 | ||||
-rw-r--r-- | Scripts/NumberNode.gd | 9 | ||||
-rw-r--r-- | Scripts/Tutorial.gd | 31 | ||||
-rw-r--r-- | project.godot | 5 |
17 files changed, 672 insertions, 6 deletions
diff --git a/Assets/Audio/lose.wav b/Assets/Audio/lose.wav Binary files differnew file mode 100644 index 0000000..eed5c79 --- /dev/null +++ b/Assets/Audio/lose.wav diff --git a/Assets/Audio/lose.wav.import b/Assets/Audio/lose.wav.import new file mode 100644 index 0000000..2553b5e --- /dev/null +++ b/Assets/Audio/lose.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://bt22xn53ylcg" +path="res://.godot/imported/lose.wav-9123983020e0b1da398cd0b44e504ad0.sample" + +[deps] + +source_file="res://Assets/Audio/lose.wav" +dest_files=["res://.godot/imported/lose.wav-9123983020e0b1da398cd0b44e504ad0.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=1 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=0 diff --git a/Assets/Audio/ouch.wav b/Assets/Audio/ouch.wav Binary files differnew file mode 100644 index 0000000..0804234 --- /dev/null +++ b/Assets/Audio/ouch.wav diff --git a/Assets/Audio/ouch.wav.import b/Assets/Audio/ouch.wav.import new file mode 100644 index 0000000..9dfc438 --- /dev/null +++ b/Assets/Audio/ouch.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://de7t4ivimmxdi" +path="res://.godot/imported/ouch.wav-9b9647cf66504508c3d541f42ba113be.sample" + +[deps] + +source_file="res://Assets/Audio/ouch.wav" +dest_files=["res://.godot/imported/ouch.wav-9b9647cf66504508c3d541f42ba113be.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=1 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=0 diff --git a/Assets/Audio/score.wav b/Assets/Audio/score.wav Binary files differnew file mode 100644 index 0000000..0efb08f --- /dev/null +++ b/Assets/Audio/score.wav diff --git a/Assets/Audio/score.wav.import b/Assets/Audio/score.wav.import new file mode 100644 index 0000000..169d285 --- /dev/null +++ b/Assets/Audio/score.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://c5moab0afjpet" +path="res://.godot/imported/score.wav-59b53d4073e404312446770834e2c604.sample" + +[deps] + +source_file="res://Assets/Audio/score.wav" +dest_files=["res://.godot/imported/score.wav-59b53d4073e404312446770834e2c604.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=1 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=0 diff --git a/Assets/Audio/win.wav b/Assets/Audio/win.wav Binary files differnew file mode 100644 index 0000000..e975fdd --- /dev/null +++ b/Assets/Audio/win.wav diff --git a/Assets/Audio/win.wav.import b/Assets/Audio/win.wav.import new file mode 100644 index 0000000..8ba64ef --- /dev/null +++ b/Assets/Audio/win.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://cgoxk43t03yqt" +path="res://.godot/imported/win.wav-9a5c5cbee9f3ddbce82c7c33ac28b561.sample" + +[deps] + +source_file="res://Assets/Audio/win.wav" +dest_files=["res://.godot/imported/win.wav-9a5c5cbee9f3ddbce82c7c33ac28b561.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=1 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=0 diff --git a/Assets/Visuals/hole.png b/Assets/Visuals/hole.png Binary files differnew file mode 100644 index 0000000..14e694e --- /dev/null +++ b/Assets/Visuals/hole.png diff --git a/Assets/Visuals/hole.png.import b/Assets/Visuals/hole.png.import new file mode 100644 index 0000000..8e8e8a2 --- /dev/null +++ b/Assets/Visuals/hole.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bumq6rg220orv" +path="res://.godot/imported/hole.png-ddbcd0e0487d2a0e86e9b143acd7834c.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/Visuals/hole.png" +dest_files=["res://.godot/imported/hole.png-ddbcd0e0487d2a0e86e9b143acd7834c.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/game.tscn b/Levels/game.tscn index 6e11d2a..c3df8e6 100644 --- a/Levels/game.tscn +++ b/Levels/game.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=17 format=3 uid="uid://rd1m2fu22g1s"] +[gd_scene load_steps=24 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"] @@ -6,6 +6,7 @@ [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://Scripts/Tutorial.gd" id="4_fqetg"] [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"] @@ -13,6 +14,9 @@ [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"] +[ext_resource type="AudioStream" uid="uid://cgoxk43t03yqt" path="res://Assets/Audio/win.wav" id="14_62x5v"] +[ext_resource type="AudioStream" uid="uid://bt22xn53ylcg" path="res://Assets/Audio/lose.wav" id="15_q08y5"] +[ext_resource type="Texture2D" uid="uid://bumq6rg220orv" path="res://Assets/Visuals/hole.png" id="17_tl6rx"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_ludyn"] size = Vector2(38, 38) @@ -23,6 +27,92 @@ radius = 260.83 [sub_resource type="CircleShape2D" id="CircleShape2D_4p6y7"] radius = 160.0 +[sub_resource type="Animation" id="Animation_3chpf"] +length = 0.001 +loop_mode = 1 + +[sub_resource type="Animation" id="Animation_ugcil"] +resource_name = "win" +length = 7.0 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("TextureRect2:scale") +tracks/0/interp = 2 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(1.00255, 1.11788, 1.45173), +"transitions": PackedFloat32Array(1, 1, 1), +"update": 0, +"values": [Vector2(0, 0), Vector2(0.003, 0.003), Vector2(0.42251, 0.392513)] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("TextureRect:scale") +tracks/1/interp = 2 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(1.11412, 1.17928, 1.50156), +"transitions": PackedFloat32Array(1, 1, 1), +"update": 0, +"values": [Vector2(0, 0), Vector2(0.1, 0.1), Vector2(0.4, 0.4)] +} +tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath("WonLabel:scale") +tracks/2/interp = 2 +tracks/2/loop_wrap = true +tracks/2/keys = { +"times": PackedFloat32Array(1.32477, 2.07709), +"transitions": PackedFloat32Array(0.258816, 2.12929), +"update": 0, +"values": [Vector2(0, 0), Vector2(1, 1)] +} +tracks/3/type = "value" +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/path = NodePath("WonLabel:position") +tracks/3/interp = 2 +tracks/3/loop_wrap = true +tracks/3/keys = { +"times": PackedFloat32Array(1.38495, 2.07709), +"transitions": PackedFloat32Array(0.210224, 0.659754), +"update": 0, +"values": [Vector2(530, 300), Vector2(0, 0)] +} +tracks/4/type = "value" +tracks/4/imported = false +tracks/4/enabled = true +tracks/4/path = NodePath("ResetLabel2:theme_override_colors/font_color") +tracks/4/interp = 1 +tracks/4/loop_wrap = true +tracks/4/keys = { +"times": PackedFloat32Array(2.65637, 3.63815), +"transitions": PackedFloat32Array(1, 1), +"update": 0, +"values": [Color(0.717647, 0.717647, 0.717647, 0), Color(0.717647, 0.717647, 0.717647, 1)] +} +tracks/5/type = "value" +tracks/5/imported = false +tracks/5/enabled = true +tracks/5/path = NodePath("ResetLabel2:theme_override_colors/font_outline_color") +tracks/5/interp = 1 +tracks/5/loop_wrap = true +tracks/5/keys = { +"times": PackedFloat32Array(2.66013, 3.62686), +"transitions": PackedFloat32Array(1, 1), +"update": 0, +"values": [Color(0.113725, 0.184314, 0.541176, 0), Color(0.113725, 0.184314, 0.541176, 1)] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_1r2yy"] +_data = { +"RESET": SubResource("Animation_3chpf"), +"win": SubResource("Animation_ugcil") +} + [node name="MainNode2D" type="Node2D"] [node name="Generator" type="Node" parent="."] @@ -31,16 +121,26 @@ numbernode = ExtResource("1_j877y") min_nodes = 60 max_nodes = 90 -[node name="GameLoop" type="Node" parent="." node_paths=PackedStringArray("label", "turn_label")] +[node name="GameLoop" type="Node" parent="." node_paths=PackedStringArray("label", "turn_label", "win_control", "anim", "anim_label")] script = ExtResource("3_u7xnc") turns = 10 label = NodePath("../Control/HBoxContainer/Label") turn_label = NodePath("../Control/TurnLabel") level = "res://Levels/game.tscn" +win_control = NodePath("../Control/Won") +anim = NodePath("../Control/Won/AnimationPlayer") +anim_label = NodePath("../Control/Won/WonLabel") [node name="BetweenPlayerAndAI" type="Timer" parent="GameLoop"] one_shot = true +[node name="AudioDelay" type="Timer" parent="GameLoop"] +one_shot = true + +[node name="Tutorial" type="Node" parent="." node_paths=PackedStringArray("step_controls")] +script = ExtResource("4_fqetg") +step_controls = [NodePath("../Control/Tutorial0"), NodePath("../Control/Tutorial1"), NodePath("../Control/Tutorial2"), NodePath("../Control/Tutorial3"), NodePath("../Control/Tutorial4")] + [node name="Player" parent="." instance=ExtResource("1_j877y")] z_index = 4096 position = Vector2(68, 661) @@ -282,7 +382,7 @@ offset_top = 297.0 offset_right = 1424.0 offset_bottom = 809.0 rotation = -0.170645 -scale = Vector2(0.42251, 0.392513) +scale = Vector2(1e-05, 1e-05) texture = ExtResource("13_8aorr") [node name="TextureRect" type="TextureRect" parent="Control/Won"] @@ -292,7 +392,7 @@ offset_left = 435.0 offset_top = 255.0 offset_right = 1459.0 offset_bottom = 767.0 -scale = Vector2(0.4, 0.4) +scale = Vector2(1e-05, 1e-05) texture = ExtResource("13_8aorr") [node name="WonLabel" type="Label" parent="Control/Won"] @@ -300,8 +400,13 @@ layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 +offset_left = 530.0 +offset_top = 300.0 +offset_right = 530.0 +offset_bottom = 300.0 grow_horizontal = 2 grow_vertical = 2 +scale = Vector2(1e-05, 1e-05) 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 @@ -311,7 +416,361 @@ text = "YOU won!" horizontal_alignment = 1 vertical_alignment = 1 +[node name="ResetLabel2" type="Label" parent="Control/Won"] +layout_mode = 1 +anchors_preset = 3 +anchor_left = 1.0 +anchor_top = 1.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = -700.0 +offset_top = -316.0 +offset_right = -562.0 +offset_bottom = -288.0 +grow_horizontal = 0 +grow_vertical = 0 +theme_override_colors/font_color = Color(0.717647, 0.717647, 0.717647, 0) +theme_override_colors/font_outline_color = Color(0.113725, 0.184314, 0.541176, 0) +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="AnimationPlayer" type="AnimationPlayer" parent="Control/Won"] +libraries = { +"": SubResource("AnimationLibrary_1r2yy") +} + +[node name="Win" type="AudioStreamPlayer2D" parent="Control/Won"] +stream = ExtResource("14_62x5v") + +[node name="Lose" type="AudioStreamPlayer2D" parent="Control/Won"] +stream = ExtResource("15_q08y5") + +[node name="Tutorial0" type="Control" parent="Control"] +visible = false +anchors_preset = 0 +offset_right = 40.0 +offset_bottom = 40.0 + +[node name="TextureRect" type="TextureRect" parent="Control/Tutorial0"] +modulate = Color(1, 1, 1, 0.439216) +layout_mode = 0 +offset_left = -572.0 +offset_top = 295.0 +offset_right = 1988.0 +offset_bottom = 1735.0 +scale = Vector2(0.5, 0.5) +texture = ExtResource("17_tl6rx") + +[node name="ColorRect" type="ColorRect" parent="Control/Tutorial0"] +layout_mode = 0 +offset_left = -128.0 +offset_top = -98.0 +offset_right = 1459.0 +offset_bottom = 295.0 +color = Color(0, 0, 0, 0.439216) + +[node name="ColorRect2" type="ColorRect" parent="Control/Tutorial0"] +layout_mode = 0 +offset_left = 708.0 +offset_top = 295.0 +offset_right = 1459.0 +offset_bottom = 1357.0 +color = Color(0, 0, 0, 0.439216) + +[node name="Label" type="Label" parent="Control/Tutorial0"] +layout_mode = 1 +anchors_preset = 3 +anchor_left = 1.0 +anchor_top = 1.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = 123.0 +offset_top = 535.0 +offset_right = 371.0 +offset_bottom = 584.0 +grow_horizontal = 0 +grow_vertical = 0 +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 = 5 +theme_override_fonts/font = ExtResource("4_cjrjl") +theme_override_font_sizes/font_size = 18 +text = "hey +this is you, you are a number" + +[node name="Label2" type="Label" parent="Control/Tutorial0"] +layout_mode = 1 +anchors_preset = 3 +anchor_left = 1.0 +anchor_top = 1.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = 150.0 +offset_top = 594.0 +offset_right = 289.0 +offset_bottom = 622.0 +grow_horizontal = 0 +grow_vertical = 0 +theme_override_colors/font_color = Color(0.713726, 0.713726, 0.713726, 1) +theme_override_colors/font_outline_color = Color(0, 0, 0, 1) +theme_override_constants/outline_size = 5 +theme_override_fonts/font = ExtResource("4_cjrjl") +theme_override_font_sizes/font_size = 18 +text = "[space] for next" + +[node name="Tutorial1" type="Control" parent="Control"] +visible = false +anchors_preset = 0 +offset_right = 40.0 +offset_bottom = 40.0 + +[node name="TextureRect" type="TextureRect" parent="Control/Tutorial1"] +modulate = Color(1, 1, 1, 0.439216) +layout_mode = 0 +offset_left = 570.0 +offset_top = -297.0 +offset_right = 3130.0 +offset_bottom = 1143.0 +scale = Vector2(0.5, 0.5) +texture = ExtResource("17_tl6rx") + +[node name="ColorRect" type="ColorRect" parent="Control/Tutorial1"] +layout_mode = 0 +offset_left = -128.0 +offset_top = -98.0 +offset_right = 570.0 +offset_bottom = 1086.0 +color = Color(0, 0, 0, 0.439216) + +[node name="ColorRect2" type="ColorRect" parent="Control/Tutorial1"] +layout_mode = 0 +offset_left = 570.0 +offset_top = 423.0 +offset_right = 1397.0 +offset_bottom = 882.0 +color = Color(0, 0, 0, 0.439216) + +[node name="Label" type="Label" parent="Control/Tutorial1"] +layout_mode = 1 +anchors_preset = 3 +anchor_left = 1.0 +anchor_top = 1.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = 740.0 +offset_top = -21.0 +offset_right = 1072.0 +offset_bottom = 54.0 +grow_horizontal = 0 +grow_vertical = 0 +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 = 5 +theme_override_fonts/font = ExtResource("4_cjrjl") +theme_override_font_sizes/font_size = 18 +text = "that, is an ai. +defeat him by getting a +larger number" +horizontal_alignment = 2 + +[node name="Label2" type="Label" parent="Control/Tutorial1"] +layout_mode = 1 +anchors_preset = 3 +anchor_left = 1.0 +anchor_top = 1.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = 1070.0 +offset_top = 128.0 +offset_right = 1209.0 +offset_bottom = 156.0 +grow_horizontal = 0 +grow_vertical = 0 +theme_override_colors/font_color = Color(0.713726, 0.713726, 0.713726, 1) +theme_override_colors/font_outline_color = Color(0, 0, 0, 1) +theme_override_constants/outline_size = 5 +theme_override_fonts/font = ExtResource("4_cjrjl") +theme_override_font_sizes/font_size = 18 +text = "[space] for next" + +[node name="Tutorial2" type="Control" parent="Control"] +visible = false +anchors_preset = 0 +offset_right = 40.0 +offset_bottom = 40.0 +mouse_filter = 1 + +[node name="TextureRect" type="TextureRect" parent="Control/Tutorial2"] +modulate = Color(0, 0, 0, 0.662745) +layout_mode = 0 +offset_left = 244.0 +offset_top = 534.0 +offset_right = 1372.0 +offset_bottom = 1110.0 +scale = Vector2(0.25, 0.25) +texture = ExtResource("13_8aorr") + +[node name="Label" type="Label" parent="Control/Tutorial2"] +layout_mode = 1 +anchors_preset = 3 +anchor_left = 1.0 +anchor_top = 1.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = 230.0 +offset_top = 539.0 +offset_right = 457.0 +offset_bottom = 588.0 +grow_horizontal = 0 +grow_vertical = 0 +theme_override_colors/font_color = Color(1, 1, 1, 1) +theme_override_colors/font_outline_color = Color(0, 0, 0, 1) +theme_override_fonts/font = ExtResource("4_cjrjl") +theme_override_font_sizes/font_size = 18 +text = "join numbers together +by dragging and dropping. +you take turns with the ai." + +[node name="Label2" type="Label" parent="Control/Tutorial2"] +layout_mode = 1 +anchors_preset = 3 +anchor_left = 1.0 +anchor_top = 1.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = 322.0 +offset_top = 596.0 +offset_right = 461.0 +offset_bottom = 624.0 +grow_horizontal = 0 +grow_vertical = 0 +theme_override_colors/font_color = Color(0.713726, 0.713726, 0.713726, 1) +theme_override_colors/font_outline_color = Color(0, 0, 0, 1) +theme_override_fonts/font = ExtResource("4_cjrjl") +theme_override_font_sizes/font_size = 18 +text = "[space] for next" + +[node name="Tutorial3" type="Control" parent="Control"] +visible = false +anchors_preset = 0 +offset_right = 40.0 +offset_bottom = 40.0 +mouse_filter = 1 + +[node name="TextureRect" type="TextureRect" parent="Control/Tutorial3"] +modulate = Color(0, 0, 0, 0.662745) +layout_mode = 0 +offset_left = 316.0 +offset_top = 425.0 +offset_right = 1340.0 +offset_bottom = 937.0 +scale = Vector2(0.3, 0.3) +texture = ExtResource("13_8aorr") + +[node name="Label" type="Label" parent="Control/Tutorial3"] +layout_mode = 1 +anchors_preset = 3 +anchor_left = 1.0 +anchor_top = 1.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = 295.0 +offset_top = 401.0 +offset_right = 555.0 +offset_bottom = 502.0 +grow_horizontal = 0 +grow_vertical = 0 +theme_override_colors/font_color = Color(1, 1, 1, 1) +theme_override_colors/font_outline_color = Color(0, 0, 0, 1) +theme_override_fonts/font = ExtResource("4_cjrjl") +theme_override_font_sizes/font_size = 18 +text = "some numbers have modifiers +in them, they can do extra +operations after you join a +number." + +[node name="Label2" type="Label" parent="Control/Tutorial3"] +layout_mode = 1 +anchors_preset = 3 +anchor_left = 1.0 +anchor_top = 1.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = 421.0 +offset_top = 498.0 +offset_right = 560.0 +offset_bottom = 526.0 +grow_horizontal = 0 +grow_vertical = 0 +theme_override_colors/font_color = Color(0.713726, 0.713726, 0.713726, 1) +theme_override_colors/font_outline_color = Color(0, 0, 0, 1) +theme_override_fonts/font = ExtResource("4_cjrjl") +theme_override_font_sizes/font_size = 18 +text = "[space] for next" + +[node name="Tutorial4" type="Control" parent="Control"] +visible = false +anchors_preset = 0 +offset_right = 40.0 +offset_bottom = 40.0 +mouse_filter = 1 + +[node name="TextureRect" type="TextureRect" parent="Control/Tutorial4"] +modulate = Color(0, 0, 0, 0.662745) +layout_mode = 0 +offset_left = 316.0 +offset_top = 425.0 +offset_right = 1340.0 +offset_bottom = 937.0 +scale = Vector2(0.32, 0.32) +texture = ExtResource("13_8aorr") + +[node name="Label" type="Label" parent="Control/Tutorial4"] +layout_mode = 1 +anchors_preset = 3 +anchor_left = 1.0 +anchor_top = 1.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = 306.0 +offset_top = 411.0 +offset_right = 541.0 +offset_bottom = 512.0 +grow_horizontal = 0 +grow_vertical = 0 +theme_override_colors/font_color = Color(1, 1, 1, 1) +theme_override_colors/font_outline_color = Color(0, 0, 0, 1) +theme_override_fonts/font = ExtResource("4_cjrjl") +theme_override_font_sizes/font_size = 18 +text = "easy, right? +well, good luck! +(oh right, [R] to reset if you +got stuck)" + +[node name="Label2" type="Label" parent="Control/Tutorial4"] +layout_mode = 1 +anchors_preset = 3 +anchor_left = 1.0 +anchor_top = 1.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = 424.0 +offset_top = 508.0 +offset_right = 569.0 +offset_bottom = 536.0 +grow_horizontal = 0 +grow_vertical = 0 +theme_override_colors/font_color = Color(0.713726, 0.713726, 0.713726, 1) +theme_override_colors/font_outline_color = Color(0, 0, 0, 1) +theme_override_fonts/font = ExtResource("4_cjrjl") +theme_override_font_sizes/font_size = 18 +text = "[space] for done" + [connection signal="timeout" from="GameLoop/BetweenPlayerAndAI" to="GameLoop" method="_on_between_player_and_ai_timeout"] +[connection signal="timeout" from="GameLoop/AudioDelay" to="GameLoop" method="_on_audio_delay_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 ed5de58..74e5559 100644 --- a/Reusable Scenes/number_node.tscn +++ b/Reusable Scenes/number_node.tscn @@ -1,8 +1,10 @@ -[gd_scene load_steps=8 format=3 uid="uid://ccvoi0qmvlxmj"] +[gd_scene load_steps=10 format=3 uid="uid://ccvoi0qmvlxmj"] [ext_resource type="Script" path="res://Scripts/NumberNode.gd" id="1_7p1bu"] [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"] +[ext_resource type="AudioStream" uid="uid://c5moab0afjpet" path="res://Assets/Audio/score.wav" id="4_flqws"] +[ext_resource type="AudioStream" uid="uid://de7t4ivimmxdi" path="res://Assets/Audio/ouch.wav" id="5_peh70"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_ld6aj"] size = Vector2(44, 46) @@ -83,5 +85,11 @@ text = "X" horizontal_alignment = 1 vertical_alignment = 1 +[node name="Score" type="AudioStreamPlayer2D" parent="."] +stream = ExtResource("4_flqws") + +[node name="Ouch" type="AudioStreamPlayer2D" parent="."] +stream = ExtResource("5_peh70") + [connection signal="mouse_entered" from="NumberArea2D" to="NumberArea2D" method="_on_mouse_entered"] [connection signal="mouse_exited" from="NumberArea2D" to="NumberArea2D" method="_on_mouse_exited"] diff --git a/Scripts/GameLoop.gd b/Scripts/GameLoop.gd index 6b71faf..6446fbd 100644 --- a/Scripts/GameLoop.gd +++ b/Scripts/GameLoop.gd @@ -6,6 +6,9 @@ class_name GameLoop @export var turn_label : Label @export_file var level : String @export var can_play : bool = true +@export var win_control : Control +@export var anim : AnimationPlayer +@export var anim_label : Label var current_turns : int = 0 var prev_turn : int = -1 @@ -23,7 +26,7 @@ func _process(_delta): 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) @@ -32,3 +35,23 @@ func _on_between_player_and_ai_timeout(): can_play = true if current_turns < turns: turn_label.text = "your turn!" else: turn_label.text = "" + + if current_turns >= turns: + win_control.visible = true + anim.play("win") + if GlobalVariables.player.get_node("..").value > GlobalVariables.ai.get_node("..").value: + anim_label.text = "YOU won!" + elif GlobalVariables.player.get_node("..").value < GlobalVariables.ai.get_node("..").value: + anim_label.text = "AI won!" + else: + anim_label.text = "It's a TIE!" + + $"AudioDelay".start() + +func _on_audio_delay_timeout(): + if GlobalVariables.player.get_node("..").value > GlobalVariables.ai.get_node("..").value: + win_control.get_node("Win").play() + elif GlobalVariables.player.get_node("..").value < GlobalVariables.ai.get_node("..").value: + win_control.get_node("Lose").play() + else: + win_control.get_node("Win").play() diff --git a/Scripts/GlobalVariables.gd b/Scripts/GlobalVariables.gd index fd7ce6c..12fb6b1 100644 --- a/Scripts/GlobalVariables.gd +++ b/Scripts/GlobalVariables.gd @@ -8,3 +8,4 @@ var is_snapping : bool = false var player : Player var ai : AI var gameloop : GameLoop +var tutorial_played : bool = false diff --git a/Scripts/NumberNode.gd b/Scripts/NumberNode.gd index b81481a..5fc4742 100644 --- a/Scripts/NumberNode.gd +++ b/Scripts/NumberNode.gd @@ -44,6 +44,8 @@ func _physics_process(_delta): shadow_sprite.scale = sprite.scale func join_from(node : NumberNode): + var prev_value = node.value + node.value += self.value var modifier_label = node.get_node_or_null("ModifierLabel") @@ -63,6 +65,13 @@ func join_from(node : NumberNode): node.target_pos = self.position node.update_visuals() + + if node.value >= prev_value: + print("YYY") + node.get_node("Score").playing = true + else: + print("NNOOOOOO") + node.get_node("Ouch").playing = true queue_free() diff --git a/Scripts/Tutorial.gd b/Scripts/Tutorial.gd new file mode 100644 index 0000000..91236eb --- /dev/null +++ b/Scripts/Tutorial.gd @@ -0,0 +1,31 @@ +extends Node +class_name Tutorial +## OH NO 1 HOUR LEFT + +@export var step_controls : Array[Control] +@export var current_step : int = 0 + +var tutorial_started = false + +func _ready(): + if !GlobalVariables.tutorial_played: + start_tutorial() + +func _input(_event): + if Input.is_action_just_pressed("space") && tutorial_started: + next_step() + +func start_tutorial(): + tutorial_started = true + step_controls[0].visible = true + current_step = 0 + +func next_step(): + if current_step + 1 < step_controls.size(): + step_controls[current_step].visible = false + step_controls[current_step + 1].visible = true + current_step += 1 + else: + step_controls[current_step].visible = false + tutorial_started = false + GlobalVariables.tutorial_played = true diff --git a/project.godot b/project.godot index a2bea0b..9c05ae9 100644 --- a/project.godot +++ b/project.godot @@ -33,6 +33,11 @@ reset={ "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":82,"key_label":0,"unicode":114,"echo":false,"script":null) ] } +space={ +"deadzone": 0.5, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":32,"echo":false,"script":null) +] +} [rendering] |