diff --git a/UI/clues/bubble_clue.tscn b/UI/clues/bubble_clue.tscn new file mode 100644 index 0000000..fe57466 --- /dev/null +++ b/UI/clues/bubble_clue.tscn @@ -0,0 +1,90 @@ +[gd_scene load_steps=7 format=3 uid="uid://dn10ervwv15oo"] + +[ext_resource type="Texture2D" uid="uid://cwbhdira3w8qx" path="res://assest/ui/UI_48x48.png" id="1_o6ktm"] +[ext_resource type="Script" path="res://UI/clues/button_clue.gd" id="2_iwm3w"] + +[sub_resource type="LabelSettings" id="LabelSettings_yr8f5"] +font_color = Color(0, 0, 0, 1) + +[sub_resource type="Animation" id="Animation_srt4p"] +loop_mode = 1 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath(".:offset") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector2(0, 0)] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("Label:position") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector2(-18, -14)] +} + +[sub_resource type="Animation" id="Animation_puwvl"] +resource_name = "move" +loop_mode = 1 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath(".:offset") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 0.266667, 0.533333, 0.733333), +"transitions": PackedFloat32Array(1, 1, 1, 1), +"update": 1, +"values": [Vector2(0, 0), Vector2(0, 1), Vector2(0, 2), Vector2(0, 1)] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("Label:position") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0, 0.266667, 0.533333, 0.733333), +"transitions": PackedFloat32Array(1, 1, 1, 1), +"update": 1, +"values": [Vector2(-18, -14), Vector2(-18, -13), Vector2(-18, -12), Vector2(-18, -13)] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_kli7q"] +_data = { +"RESET": SubResource("Animation_srt4p"), +"move": SubResource("Animation_puwvl") +} + +[node name="Sprite2D" type="Sprite2D"] +texture = ExtResource("1_o6ktm") +hframes = 18 +vframes = 9 +frame = 5 +script = ExtResource("2_iwm3w") + +[node name="Label" type="Label" parent="."] +offset_left = -18.0 +offset_top = -14.0 +offset_right = 18.0 +offset_bottom = 19.0 +text = "E" +label_settings = SubResource("LabelSettings_yr8f5") +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +libraries = { +"": SubResource("AnimationLibrary_kli7q") +} diff --git a/UI/clues/button_clue.gd b/UI/clues/button_clue.gd new file mode 100644 index 0000000..10993ea --- /dev/null +++ b/UI/clues/button_clue.gd @@ -0,0 +1,9 @@ +extends Sprite2D +class_name Clue + +func setVisible(isV: bool): + visible = isV + if isV: + $AnimationPlayer.play("move") + else: + $AnimationPlayer.stop() diff --git a/UI/clues/button_clue.tscn b/UI/clues/button_clue.tscn new file mode 100644 index 0000000..d69e510 --- /dev/null +++ b/UI/clues/button_clue.tscn @@ -0,0 +1,87 @@ +[gd_scene load_steps=6 format=3 uid="uid://clqdxhwojbkwp"] + +[ext_resource type="Texture2D" uid="uid://b7k2x0bnxlhwh" path="res://assest/ui/Modern_UI_Style_2_48x48.png" id="1_cr0we"] +[ext_resource type="Script" path="res://UI/clues/button_clue.gd" id="2_md8cj"] + +[sub_resource type="Animation" id="Animation_srt4p"] +loop_mode = 1 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath(".:frame") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 0.233333, 0.5, 0.733333), +"transitions": PackedFloat32Array(1, 1, 1, 1), +"update": 1, +"values": [432, 433, 434, 433] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("Label:position") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0, 0.233333, 0.5, 0.733333), +"transitions": PackedFloat32Array(1, 1, 1, 1), +"update": 1, +"values": [Vector2(-18, 3), Vector2(-18, 5), Vector2(-18, 7), Vector2(-18, 5)] +} + +[sub_resource type="Animation" id="Animation_puwvl"] +resource_name = "move" +length = 0.75 +loop_mode = 1 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath(".:frame") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 0.266667, 0.533333), +"transitions": PackedFloat32Array(1, 1, 1), +"update": 1, +"values": [432, 433, 434] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("Label:position") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0, 0.266667, 0.533333), +"transitions": PackedFloat32Array(1, 1, 1), +"update": 1, +"values": [Vector2(-18, 3), Vector2(-18, 5), Vector2(-18, 7)] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_kli7q"] +_data = { +"RESET": SubResource("Animation_srt4p"), +"move": SubResource("Animation_puwvl") +} + +[node name="Sprite2D" type="Sprite2D"] +texture = ExtResource("1_cr0we") +hframes = 49 +vframes = 17 +frame = 432 +script = ExtResource("2_md8cj") + +[node name="Label" type="Label" parent="."] +offset_left = -18.0 +offset_top = 3.0 +offset_right = 18.0 +offset_bottom = 36.0 +text = "E" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +libraries = { +"": SubResource("AnimationLibrary_kli7q") +} diff --git a/assest/ui/Modern_UI_Style_2_48x48.png b/assest/ui/Modern_UI_Style_2_48x48.png new file mode 100644 index 0000000..abf7f88 Binary files /dev/null and b/assest/ui/Modern_UI_Style_2_48x48.png differ diff --git a/assest/ui/Modern_UI_Style_2_48x48.png.import b/assest/ui/Modern_UI_Style_2_48x48.png.import new file mode 100644 index 0000000..b5ae974 --- /dev/null +++ b/assest/ui/Modern_UI_Style_2_48x48.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b7k2x0bnxlhwh" +path="res://.godot/imported/Modern_UI_Style_2_48x48.png-8fd28b9a4f551fa871cd26e907396b1b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assest/ui/Modern_UI_Style_2_48x48.png" +dest_files=["res://.godot/imported/Modern_UI_Style_2_48x48.png-8fd28b9a4f551fa871cd26e907396b1b.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/assest/ui/UI_48x48.png b/assest/ui/UI_48x48.png new file mode 100644 index 0000000..1386017 Binary files /dev/null and b/assest/ui/UI_48x48.png differ diff --git a/assest/ui/UI_48x48.png.import b/assest/ui/UI_48x48.png.import new file mode 100644 index 0000000..030504e --- /dev/null +++ b/assest/ui/UI_48x48.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cwbhdira3w8qx" +path="res://.godot/imported/UI_48x48.png-a74dc45591fe65edc9542a52dfb2774e.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assest/ui/UI_48x48.png" +dest_files=["res://.godot/imported/UI_48x48.png-a74dc45591fe65edc9542a52dfb2774e.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/assest/ui/ui.tres b/assest/ui/ui.tres new file mode 100644 index 0000000..f14b7a9 --- /dev/null +++ b/assest/ui/ui.tres @@ -0,0 +1,1217 @@ +[gd_resource type="TileSet" load_steps=5 format=3 uid="uid://b68vbmc3054c1"] + +[ext_resource type="Texture2D" uid="uid://cwbhdira3w8qx" path="res://assest/ui/UI_48x48.png" id="1_n5sa4"] +[ext_resource type="Texture2D" uid="uid://b7k2x0bnxlhwh" path="res://assest/ui/Modern_UI_Style_2_48x48.png" id="1_ofcbd"] + +[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_y6uru"] +texture = ExtResource("1_n5sa4") +texture_region_size = Vector2i(48, 48) +1:0/0 = 0 +2:0/0 = 0 +3:0/0 = 0 +4:0/0 = 0 +5:0/0 = 0 +6:0/0 = 0 +7:0/0 = 0 +8:0/0 = 0 +9:0/0 = 0 +10:0/0 = 0 +11:0/0 = 0 +12:0/0 = 0 +13:0/0 = 0 +14:0/0 = 0 +15:0/0 = 0 +16:0/0 = 0 +17:0/0 = 0 +0:1/0 = 0 +1:1/0 = 0 +2:1/0 = 0 +3:1/0 = 0 +4:1/0 = 0 +5:1/0 = 0 +6:1/0 = 0 +7:1/0 = 0 +8:1/0 = 0 +9:1/0 = 0 +10:1/0 = 0 +11:1/0 = 0 +12:1/0 = 0 +13:1/0 = 0 +14:1/0 = 0 +15:1/0 = 0 +16:1/0 = 0 +17:1/0 = 0 +0:2/0 = 0 +1:2/0 = 0 +2:2/0 = 0 +3:2/0 = 0 +4:2/0 = 0 +5:2/0 = 0 +6:2/0 = 0 +7:2/0 = 0 +8:2/0 = 0 +9:2/0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= 0 +3:9/0 = 0 +4:9/0 = 0 +5:9/0 = 0 +6:9/0 = 0 +7:9/0 = 0 +8:9/0 = 0 +9:9/0 = 0 +10:9/0 = 0 +11:9/0 = 0 +12:9/0 = 0 +0:10/0 = 0 +1:10/0 = 0 +2:10/0 = 0 +3:10/0 = 0 +4:10/0 = 0 +5:10/0 = 0 +6:10/0 = 0 +7:10/0 = 0 +0:11/0 = 0 +1:11/0 = 0 +2:11/0 = 0 +3:11/0 = 0 +4:11/0 = 0 +5:11/0 = 0 +6:11/0 = 0 +7:11/0 = 0 +8:11/0 = 0 +9:11/0 = 0 +10:11/0 = 0 +11:11/0 = 0 +12:11/0 = 0 +13:11/0 = 0 +0:12/0 = 0 +1:12/0 = 0 +2:12/0 = 0 +3:12/0 = 0 +4:12/0 = 0 +5:12/0 = 0 +6:12/0 = 0 +7:12/0 = 0 +0:13/0 = 0 +1:13/0 = 0 +2:13/0 = 0 +3:13/0 = 0 +4:13/0 = 0 +5:13/0 = 0 +6:13/0 = 0 +7:13/0 = 0 +8:13/0 = 0 +9:13/0 = 0 +10:13/0 = 0 +11:13/0 = 0 +12:13/0 = 0 +13:13/0 = 0 +0:14/0 = 0 +1:14/0 = 0 +2:14/0 = 0 +3:14/0 = 0 +4:14/0 = 0 +5:14/0 = 0 +8:14/0 = 0 +9:14/0 = 0 +10:14/0 = 0 +11:14/0 = 0 +12:14/0 = 0 +13:14/0 = 0 +0:15/0 = 0 +1:15/0 = 0 +2:15/0 = 0 +3:15/0 = 0 +4:15/0 = 0 +5:15/0 = 0 +8:15/0 = 0 +9:15/0 = 0 +10:15/0 = 0 +11:15/0 = 0 +12:15/0 = 0 +13:15/0 = 0 + +[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_vsb1o"] +texture = ExtResource("1_ofcbd") +texture_region_size = Vector2i(48, 48) +0:0/0 = 0 +1:0/0 = 0 +2:0/0 = 0 +3:0/0 = 0 +4:0/0 = 0 +5:0/0 = 0 +8:0/0 = 0 +9:0/0 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+47:9/0 = 0 +48:9/0 = 0 +0:10/0 = 0 +1:10/0 = 0 +2:10/0 = 0 +3:10/0 = 0 +4:10/0 = 0 +5:10/0 = 0 +8:10/0 = 0 +9:10/0 = 0 +10:10/0 = 0 +11:10/0 = 0 +12:10/0 = 0 +13:10/0 = 0 +14:10/0 = 0 +16:10/0 = 0 +17:10/0 = 0 +18:10/0 = 0 +19:10/0 = 0 +20:10/0 = 0 +21:10/0 = 0 +22:10/0 = 0 +24:10/0 = 0 +25:10/0 = 0 +26:10/0 = 0 +27:10/0 = 0 +28:10/0 = 0 +29:10/0 = 0 +34:10/0 = 0 +37:10/0 = 0 +40:10/0 = 0 +43:10/0 = 0 +46:10/0 = 0 +0:11/0 = 0 +1:11/0 = 0 +2:11/0 = 0 +3:11/0 = 0 +4:11/0 = 0 +5:11/0 = 0 +8:11/0 = 0 +10:11/0 = 0 +12:11/0 = 0 +13:11/0 = 0 +14:11/0 = 0 +16:11/0 = 0 +18:11/0 = 0 +19:11/0 = 0 +21:11/0 = 0 +22:11/0 = 0 +34:11/0 = 0 +35:11/0 = 0 +36:11/0 = 0 +37:11/0 = 0 +38:11/0 = 0 +39:11/0 = 0 +40:11/0 = 0 +41:11/0 = 0 +42:11/0 = 0 +43:11/0 = 0 +44:11/0 = 0 +45:11/0 = 0 +46:11/0 = 0 +47:11/0 = 0 +48:11/0 = 0 +0:12/0 = 0 +1:12/0 = 0 +2:12/0 = 0 +3:12/0 = 0 +4:12/0 = 0 +5:12/0 = 0 +8:12/0 = 0 +10:12/0 = 0 +12:12/0 = 0 +16:12/0 = 0 +18:12/0 = 0 +21:12/0 = 0 +22:12/0 = 0 +34:12/0 = 0 +37:12/0 = 0 +40:12/0 = 0 +43:12/0 = 0 +46:12/0 = 0 +3:13/0 = 0 +4:13/0 = 0 +5:13/0 = 0 +9:13/0 = 0 +10:13/0 = 0 +11:13/0 = 0 +12:13/0 = 0 +16:13/0 = 0 +17:13/0 = 0 +18:13/0 = 0 +19:13/0 = 0 +20:13/0 = 0 +21:13/0 = 0 +22:13/0 = 0 +34:13/0 = 0 +35:13/0 = 0 +36:13/0 = 0 +37:13/0 = 0 +38:13/0 = 0 +39:13/0 = 0 +40:13/0 = 0 +41:13/0 = 0 +42:13/0 = 0 +43:13/0 = 0 +44:13/0 = 0 +45:13/0 = 0 +46:13/0 = 0 +47:13/0 = 0 +48:13/0 = 0 +0:14/0 = 0 +1:14/0 = 0 +2:14/0 = 0 +3:14/0 = 0 +4:14/0 = 0 +5:14/0 = 0 +7:14/0 = 0 +8:14/0 = 0 +9:14/0 = 0 +10:14/0 = 0 +11:14/0 = 0 +12:14/0 = 0 +13:14/0 = 0 +14:14/0 = 0 +16:14/0 = 0 +18:14/0 = 0 +19:14/0 = 0 +21:14/0 = 0 +22:14/0 = 0 +25:14/0 = 0 +26:14/0 = 0 +27:14/0 = 0 +28:14/0 = 0 +34:14/0 = 0 +37:14/0 = 0 +40:14/0 = 0 +43:14/0 = 0 +46:14/0 = 0 +0:15/0 = 0 +1:15/0 = 0 +2:15/0 = 0 +3:15/0 = 0 +4:15/0 = 0 +5:15/0 = 0 +7:15/0 = 0 +8:15/0 = 0 +9:15/0 = 0 +10:15/0 = 0 +11:15/0 = 0 +12:15/0 = 0 +13:15/0 = 0 +14:15/0 = 0 +16:15/0 = 0 +18:15/0 = 0 +21:15/0 = 0 +22:15/0 = 0 +24:15/0 = 0 +25:15/0 = 0 +26:15/0 = 0 +27:15/0 = 0 +28:15/0 = 0 +29:15/0 = 0 +30:15/0 = 0 +31:15/0 = 0 +32:15/0 = 0 +34:15/0 = 0 +35:15/0 = 0 +36:15/0 = 0 +37:15/0 = 0 +38:15/0 = 0 +39:15/0 = 0 +40:15/0 = 0 +41:15/0 = 0 +42:15/0 = 0 +43:15/0 = 0 +44:15/0 = 0 +45:15/0 = 0 +46:15/0 = 0 +47:15/0 = 0 +48:15/0 = 0 +0:16/0 = 0 +1:16/0 = 0 +2:16/0 = 0 +3:16/0 = 0 +4:16/0 = 0 +5:16/0 = 0 +7:16/0 = 0 +8:16/0 = 0 +9:16/0 = 0 +10:16/0 = 0 +11:16/0 = 0 +12:16/0 = 0 +13:16/0 = 0 +14:16/0 = 0 +16:16/0 = 0 +17:16/0 = 0 +18:16/0 = 0 +19:16/0 = 0 +20:16/0 = 0 +21:16/0 = 0 +22:16/0 = 0 +24:16/0 = 0 +25:16/0 = 0 +26:16/0 = 0 +27:16/0 = 0 +28:16/0 = 0 +29:16/0 = 0 +30:16/0 = 0 +31:16/0 = 0 +32:16/0 = 0 +40:16/0 = 0 +43:16/0 = 0 +46:16/0 = 0 +0:17/0 = 0 +1:17/0 = 0 +2:17/0 = 0 +3:17/0 = 0 +4:17/0 = 0 +5:17/0 = 0 +7:17/0 = 0 +8:17/0 = 0 +9:17/0 = 0 +10:17/0 = 0 +11:17/0 = 0 +12:17/0 = 0 +13:17/0 = 0 +14:17/0 = 0 +16:17/0 = 0 +18:17/0 = 0 +19:17/0 = 0 +21:17/0 = 0 +22:17/0 = 0 +24:17/0 = 0 +25:17/0 = 0 +26:17/0 = 0 +27:17/0 = 0 +28:17/0 = 0 +29:17/0 = 0 +30:17/0 = 0 +31:17/0 = 0 +32:17/0 = 0 +40:17/0 = 0 +41:17/0 = 0 +42:17/0 = 0 +43:17/0 = 0 +44:17/0 = 0 +45:17/0 = 0 +46:17/0 = 0 +47:17/0 = 0 +48:17/0 = 0 +0:18/0 = 0 +1:18/0 = 0 +2:18/0 = 0 +3:18/0 = 0 +4:18/0 = 0 +5:18/0 = 0 +8:18/0 = 0 +9:18/0 = 0 +10:18/0 = 0 +11:18/0 = 0 +12:18/0 = 0 +13:18/0 = 0 +16:18/0 = 0 +18:18/0 = 0 +21:18/0 = 0 +22:18/0 = 0 +24:18/0 = 0 +25:18/0 = 0 +26:18/0 = 0 +27:18/0 = 0 +28:18/0 = 0 +29:18/0 = 0 +30:18/0 = 0 +31:18/0 = 0 +32:18/0 = 0 +0:19/0 = 0 +1:19/0 = 0 +2:19/0 = 0 +3:19/0 = 0 +4:19/0 = 0 +5:19/0 = 0 +8:19/0 = 0 +9:19/0 = 0 +10:19/0 = 0 +11:19/0 = 0 +12:19/0 = 0 +13:19/0 = 0 +16:19/0 = 0 +17:19/0 = 0 +18:19/0 = 0 +19:19/0 = 0 +20:19/0 = 0 +21:19/0 = 0 +22:19/0 = 0 +24:19/0 = 0 +25:19/0 = 0 +26:19/0 = 0 +27:19/0 = 0 +28:19/0 = 0 +29:19/0 = 0 +0:20/0 = 0 +1:20/0 = 0 +3:20/0 = 0 +4:20/0 = 0 +8:20/0 = 0 +9:20/0 = 0 +10:20/0 = 0 +11:20/0 = 0 +12:20/0 = 0 +13:20/0 = 0 +14:20/0 = 0 +16:20/0 = 0 +18:20/0 = 0 +19:20/0 = 0 +21:20/0 = 0 +22:20/0 = 0 +24:20/0 = 0 +25:20/0 = 0 +26:20/0 = 0 +27:20/0 = 0 +28:20/0 = 0 +29:20/0 = 0 +30:20/0 = 0 +31:20/0 = 0 +32:20/0 = 0 +0:21/0 = 0 +1:21/0 = 0 +2:21/0 = 0 +3:21/0 = 0 +4:21/0 = 0 +5:21/0 = 0 +8:21/0 = 0 +9:21/0 = 0 +10:21/0 = 0 +11:21/0 = 0 +12:21/0 = 0 +13:21/0 = 0 +16:21/0 = 0 +18:21/0 = 0 +21:21/0 = 0 +22:21/0 = 0 +24:21/0 = 0 +25:21/0 = 0 +26:21/0 = 0 +27:21/0 = 0 +28:21/0 = 0 +29:21/0 = 0 +30:21/0 = 0 +31:21/0 = 0 +32:21/0 = 0 +0:22/0 = 0 +1:22/0 = 0 +2:22/0 = 0 +3:22/0 = 0 +4:22/0 = 0 +5:22/0 = 0 +9:22/0 = 0 +10:22/0 = 0 +11:22/0 = 0 +12:22/0 = 0 +15:22/0 = 0 +16:22/0 = 0 +17:22/0 = 0 +18:22/0 = 0 +19:22/0 = 0 +20:22/0 = 0 +21:22/0 = 0 +22:22/0 = 0 +24:22/0 = 0 +25:22/0 = 0 +26:22/0 = 0 +27:22/0 = 0 +28:22/0 = 0 +29:22/0 = 0 +30:22/0 = 0 +31:22/0 = 0 +32:22/0 = 0 +9:23/0 = 0 +10:23/0 = 0 +11:23/0 = 0 +12:23/0 = 0 +13:23/0 = 0 +15:23/0 = 0 +16:23/0 = 0 +17:23/0 = 0 +18:23/0 = 0 +19:23/0 = 0 +20:23/0 = 0 +21:23/0 = 0 +22:23/0 = 0 +24:23/0 = 0 +25:23/0 = 0 +26:23/0 = 0 +27:23/0 = 0 +28:23/0 = 0 +29:23/0 = 0 +30:23/0 = 0 +31:23/0 = 0 +32:23/0 = 0 +9:24/0 = 0 +10:24/0 = 0 +11:24/0 = 0 +12:24/0 = 0 +13:24/0 = 0 +14:24/0 = 0 +15:24/0 = 0 +16:24/0 = 0 +17:24/0 = 0 +18:24/0 = 0 +19:24/0 = 0 +20:24/0 = 0 +21:24/0 = 0 +24:24/0 = 0 +25:24/0 = 0 +26:24/0 = 0 +27:24/0 = 0 +28:24/0 = 0 +29:24/0 = 0 +9:25/0 = 0 +10:25/0 = 0 +11:25/0 = 0 +12:25/0 = 0 +13:25/0 = 0 +15:25/0 = 0 +16:25/0 = 0 +17:25/0 = 0 +18:25/0 = 0 +19:25/0 = 0 +20:25/0 = 0 +21:25/0 = 0 +24:25/0 = 0 +25:25/0 = 0 +26:25/0 = 0 +28:25/0 = 0 +29:25/0 = 0 +30:25/0 = 0 +32:25/0 = 0 +33:25/0 = 0 +34:25/0 = 0 +36:25/0 = 0 +37:25/0 = 0 +38:25/0 = 0 +40:25/0 = 0 +41:25/0 = 0 +42:25/0 = 0 +15:26/0 = 0 +16:26/0 = 0 +17:26/0 = 0 +18:26/0 = 0 +19:26/0 = 0 +20:26/0 = 0 +21:26/0 = 0 +22:26/0 = 0 +24:26/0 = 0 +25:26/0 = 0 +26:26/0 = 0 +28:26/0 = 0 +29:26/0 = 0 +30:26/0 = 0 +32:26/0 = 0 +33:26/0 = 0 +34:26/0 = 0 +36:26/0 = 0 +37:26/0 = 0 +38:26/0 = 0 +40:26/0 = 0 +41:26/0 = 0 +42:26/0 = 0 +15:27/0 = 0 +16:27/0 = 0 +17:27/0 = 0 +18:27/0 = 0 +19:27/0 = 0 +20:27/0 = 0 +21:27/0 = 0 +22:27/0 = 0 +24:27/0 = 0 +25:27/0 = 0 +26:27/0 = 0 +28:27/0 = 0 +29:27/0 = 0 +30:27/0 = 0 +32:27/0 = 0 +33:27/0 = 0 +34:27/0 = 0 +36:27/0 = 0 +37:27/0 = 0 +38:27/0 = 0 +40:27/0 = 0 +41:27/0 = 0 +42:27/0 = 0 +15:28/0 = 0 +16:28/0 = 0 +17:28/0 = 0 +18:28/0 = 0 +19:28/0 = 0 +20:28/0 = 0 +21:28/0 = 0 +22:28/0 = 0 +24:28/0 = 0 +25:28/0 = 0 +26:28/0 = 0 +28:28/0 = 0 +29:28/0 = 0 +30:28/0 = 0 +32:28/0 = 0 +33:28/0 = 0 +34:28/0 = 0 +36:28/0 = 0 +37:28/0 = 0 +38:28/0 = 0 +40:28/0 = 0 +41:28/0 = 0 +42:28/0 = 0 +15:29/0 = 0 +16:29/0 = 0 +17:29/0 = 0 +18:29/0 = 0 +19:29/0 = 0 +20:29/0 = 0 +21:29/0 = 0 +22:29/0 = 0 +24:29/0 = 0 +25:29/0 = 0 +26:29/0 = 0 +28:29/0 = 0 +29:29/0 = 0 +30:29/0 = 0 +32:29/0 = 0 +33:29/0 = 0 +34:29/0 = 0 +36:29/0 = 0 +37:29/0 = 0 +38:29/0 = 0 +40:29/0 = 0 +41:29/0 = 0 +42:29/0 = 0 +15:30/0 = 0 +16:30/0 = 0 +17:30/0 = 0 +18:30/0 = 0 +19:30/0 = 0 +20:30/0 = 0 +21:30/0 = 0 +22:30/0 = 0 +24:30/0 = 0 +25:30/0 = 0 +26:30/0 = 0 +28:30/0 = 0 +29:30/0 = 0 +30:30/0 = 0 +32:30/0 = 0 +33:30/0 = 0 +34:30/0 = 0 +36:30/0 = 0 +37:30/0 = 0 +38:30/0 = 0 +40:30/0 = 0 +41:30/0 = 0 +42:30/0 = 0 +17:31/0 = 0 +18:31/0 = 0 +19:31/0 = 0 +20:31/0 = 0 +24:31/0 = 0 +25:31/0 = 0 +26:31/0 = 0 +28:31/0 = 0 +29:31/0 = 0 +30:31/0 = 0 +32:31/0 = 0 +33:31/0 = 0 +34:31/0 = 0 +36:31/0 = 0 +37:31/0 = 0 +38:31/0 = 0 +40:31/0 = 0 +41:31/0 = 0 +42:31/0 = 0 +24:32/0 = 0 +25:32/0 = 0 +26:32/0 = 0 +28:32/0 = 0 +29:32/0 = 0 +30:32/0 = 0 +32:32/0 = 0 +33:32/0 = 0 +34:32/0 = 0 +36:32/0 = 0 +37:32/0 = 0 +38:32/0 = 0 +24:33/0 = 0 +25:33/0 = 0 +26:33/0 = 0 +28:33/0 = 0 +29:33/0 = 0 +30:33/0 = 0 +32:33/0 = 0 +33:33/0 = 0 +34:33/0 = 0 +36:33/0 = 0 +37:33/0 = 0 +38:33/0 = 0 + +[resource] +tile_size = Vector2i(48, 48) +sources/1 = SubResource("TileSetAtlasSource_vsb1o") +sources/0 = SubResource("TileSetAtlasSource_y6uru") diff --git a/caracters/bob/bob.gdshader b/caracters/bob/bob.gdshader new file mode 100644 index 0000000..c9eefb0 --- /dev/null +++ b/caracters/bob/bob.gdshader @@ -0,0 +1,27 @@ +shader_type canvas_item; + +uniform vec4 line_color : source_color = vec4(1); +uniform float line_thickness : hint_range(0, 10) = 1.0; + +const vec2 OFFSETS[8] = { + vec2(-1, -1), vec2(-1, 0), vec2(-1, 1), vec2(0, -1), vec2(0, 1), + vec2(1, -1), vec2(1, 0), vec2(1, 1) +}; + +void fragment() { + vec2 size = TEXTURE_PIXEL_SIZE * line_thickness / 2.0; + vec4 color = texture(TEXTURE, UV); + + float inline = 1.0; + float outline = 0.0; + for (int i = 0; i < OFFSETS.length(); i++) { + float sample = texture(TEXTURE, UV + size * OFFSETS[i]).a; + outline += sample; + inline *= sample; + } + outline = min(1.0, outline) - color.a; + inline = (1.0 - inline) * color.a; + + vec4 outlined_result = mix(color, line_color, outline + inline); + COLOR = mix(color, outlined_result, outlined_result.a); +} \ No newline at end of file diff --git a/caracters/bob/bob.tscn b/caracters/bob/bob.tscn index 1ce7de3..66900a9 100644 --- a/caracters/bob/bob.tscn +++ b/caracters/bob/bob.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=13 format=3 uid="uid://bleadp4yrdgj"] +[gd_scene load_steps=17 format=3 uid="uid://bleadp4yrdgj"] [ext_resource type="Script" path="res://caracters/human.gd" id="1_x3vfc"] [ext_resource type="AnimationNodeStateMachine" uid="uid://ddr1ltkievtku" path="res://animations/human/human_state_machine.tres" id="2_86nrf"] @@ -6,7 +6,10 @@ [ext_resource type="PackedScene" uid="uid://cg4dhp7qe68pt" path="res://animations/human/human.tscn" id="4_25owg"] [ext_resource type="Texture2D" uid="uid://c3lal83o1trpd" path="res://assest/persos/bob.png" id="5_e15yd"] [ext_resource type="PackedScene" uid="uid://brh7cqaxc13ie" path="res://zindex/ZIndexControler.tscn" id="5_g2w7l"] -[ext_resource type="Script" path="res://caracters/npc.gd" id="7_xosjn"] +[ext_resource type="Shader" path="res://caracters/bob/bob.gdshader" id="5_tpu8c"] +[ext_resource type="PackedScene" uid="uid://07byq4mh8uwv" path="res://caracters/npc_controler.tscn" id="8_uueub"] +[ext_resource type="PackedScene" uid="uid://x2asns3kiqwg" path="res://interactable/interaction_zone.tscn" id="9_35f01"] +[ext_resource type="PackedScene" uid="uid://dn10ervwv15oo" path="res://UI/clues/bubble_clue.tscn" id="10_rm4iv"] [sub_resource type="CapsuleShape2D" id="CapsuleShape2D_a4vmx"] radius = 5.0 @@ -15,7 +18,6 @@ height = 48.0 [sub_resource type="AnimationNodeTimeScale" id="AnimationNodeTimeScale_85jde"] [sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_iwsa7"] -graph_offset = Vector2(0, -4) nodes/HumanState/node = ExtResource("2_86nrf") nodes/HumanState/position = Vector2(133.333, 120) nodes/TimeScale/node = SubResource("AnimationNodeTimeScale_85jde") @@ -23,10 +25,15 @@ nodes/TimeScale/position = Vector2(453.333, 53.3333) nodes/output/position = Vector2(640, 146.667) node_connections = [&"TimeScale", 0, &"HumanState", &"output", 0, &"TimeScale"] +[sub_resource type="ShaderMaterial" id="ShaderMaterial_ilky1"] +shader = ExtResource("5_tpu8c") +shader_parameter/line_color = Color(1, 1, 1, 1) +shader_parameter/line_thickness = 0.0 + [sub_resource type="RectangleShape2D" id="RectangleShape2D_1kv0e"] size = Vector2(40, 10) -[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_6n4r3"] +[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_i362a"] radius = 52.0 height = 108.0 @@ -52,6 +59,7 @@ parameters/TimeScale/scale = 1.0 [node name="AnimationPlayer" parent="." instance=ExtResource("3_lb4ws")] [node name="Sprite2D" parent="." instance=ExtResource("4_25owg")] +material = SubResource("ShaderMaterial_ilky1") texture = ExtResource("5_e15yd") frame = 1 @@ -63,32 +71,28 @@ position = Vector2(1, -13) shape = SubResource("RectangleShape2D_1kv0e") target_position = Vector2(0, -48) -[node name="Area2D" type="Area2D" parent="."] +[node name="detector" type="Area2D" parent="."] collision_layer = 4 collision_mask = 4 -[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"] +[node name="CollisionShape2D" type="CollisionShape2D" parent="detector"] position = Vector2(0, 43) rotation = 1.5708 shape = SubResource("CapsuleShape2D_a4vmx") -[node name="npcControler" type="Node2D" parent="." node_paths=PackedStringArray("controled")] -script = ExtResource("7_xosjn") -controled = NodePath("..") +[node name="npcControler" parent="." instance=ExtResource("8_uueub")] -[node name="Label" type="Label" parent="npcControler"] -visible = false -offset_right = 40.0 -offset_bottom = 23.0 +[node name="interaction zone" parent="." node_paths=PackedStringArray("clue") instance=ExtResource("9_35f01")] +clue = NodePath("../clue") -[node name="interactable" type="Area2D" parent="."] -collision_layer = 8 -collision_mask = 8 - -[node name="CollisionShape2D" type="CollisionShape2D" parent="interactable"] +[node name="CollisionShape2D2" type="CollisionShape2D" parent="interaction zone"] position = Vector2(0, 12) -shape = SubResource("CapsuleShape2D_6n4r3") +shape = SubResource("CapsuleShape2D_i362a") + +[node name="clue" parent="." instance=ExtResource("10_rm4iv")] +z_index = 1000 +position = Vector2(44, -38) [connection signal="start_intracting" from="." to="npcControler" method="_on_character_body_2d_start_intracting"] -[connection signal="area_entered" from="Area2D" to="." method="_on_area_2d_area_entered"] -[connection signal="body_entered" from="Area2D" to="." method="_on_area_2d_body_entered"] +[connection signal="area_entered" from="detector" to="." method="_on_area_2d_area_entered"] +[connection signal="body_entered" from="detector" to="." method="_on_area_2d_body_entered"] diff --git a/caracters/bob/interactable.gd b/caracters/bob/interactable.gd deleted file mode 100644 index 05229bd..0000000 --- a/caracters/bob/interactable.gd +++ /dev/null @@ -1,5 +0,0 @@ -extends Area2D - - -func start_interaction(askingForInteraction: Human): - (get_parent() as Human).start_interaction(askingForInteraction) diff --git a/caracters/human.gd b/caracters/human.gd index 77aa99f..4aec8c2 100644 --- a/caracters/human.gd +++ b/caracters/human.gd @@ -11,6 +11,7 @@ var humanInteractionTarget: Human = null @onready var animation_tree := $AnimationTree @onready var animation_player := $AnimationPlayer @onready var state_machine := animation_tree.get("parameters/HumanState/playback") as AnimationNodeStateMachinePlayback +@onready var interactionZone : InteractionZone = $"interaction zone" signal start_intracting @@ -56,9 +57,9 @@ func _physics_process(delta): updateFacingDirectionInAnimationTree() - if wants_to_interact_with and wants_to_interact_with.get_parent().has_method("start_interaction"): + if wants_to_interact_with and wants_to_interact_with.has_method("start_interaction"): if humanInteractionTarget == null: - humanInteractionTarget = wants_to_interact_with.get_parent() as Human + humanInteractionTarget = wants_to_interact_with as Human humanInteractionTarget.start_interaction(self) func _on_area_2d_body_entered(body: Node2D) -> void: @@ -66,9 +67,25 @@ func _on_area_2d_body_entered(body: Node2D) -> void: func start_interaction(askingForInteraction: Human): emit_signal("start_intracting", askingForInteraction) + disable_interaction_clue() func stop_interaction(): humanInteractionTarget = null + enable_interaction_clue() func get_feet_global_position(): return global_position + Vector2(0, 43) + +func enable_interaction_clue(): + if interactionZone: + var mat = $Sprite2D.get("material") as ShaderMaterial + if mat: + mat.set_shader_parameter("line_thickness", 1) + interactionZone.enable_interaction_clue() + +func disable_interaction_clue(): + if interactionZone: + var mat = $Sprite2D.get("material") as ShaderMaterial + if mat: + mat.set_shader_parameter("line_thickness", 0) + interactionZone.disable_interaction_clue() diff --git a/caracters/npc.gd b/caracters/npc.gd index 00418a6..962690b 100644 --- a/caracters/npc.gd +++ b/caracters/npc.gd @@ -5,11 +5,11 @@ var toFollow: Array[Vector2i] @onready var world: TileMapLayer = get_parent().get_parent(); @onready var obstacles: TileMapLayer = world.get_children()[2] -@export var controled:Human +@onready var controled:Human = get_parent() var destination:Node2D var HumanLayer = 0 -func _ready() -> void: +func _ready() -> void: astar_grid = AStarGrid2D.new() astar_grid.region = world.get_used_rect() astar_grid.cell_size = Vector2(48, 48) @@ -67,7 +67,6 @@ func _process(delta: float) -> void: func _on_character_body_2d_start_intracting(interactingWith: Human) -> void: controled.face(interactingWith.global_position) - print("pouet") # ouvre un dialogue var resource = load("res://caracters/bob/bob.dialogue") DialogueManager.show_dialogue_balloon(resource, "start") diff --git a/caracters/npc_controler.tscn b/caracters/npc_controler.tscn new file mode 100644 index 0000000..dd18f54 --- /dev/null +++ b/caracters/npc_controler.tscn @@ -0,0 +1,11 @@ +[gd_scene load_steps=2 format=3 uid="uid://07byq4mh8uwv"] + +[ext_resource type="Script" path="res://caracters/npc.gd" id="1_x4w66"] + +[node name="npcControler" type="Node2D"] +script = ExtResource("1_x4w66") + +[node name="Label" type="Label" parent="."] +visible = false +offset_right = 40.0 +offset_bottom = 23.0 diff --git a/caracters/player/player_controler.gd b/caracters/player/player_controler.gd index e4c7086..63d0b2b 100644 --- a/caracters/player/player_controler.gd +++ b/caracters/player/player_controler.gd @@ -2,23 +2,20 @@ extends Node @export var human: Human @export var ray : ShapeCast2D -var interactable : Node2D +var can_interact_with : Node2D + +var possible_interactables : Array[Node2D] func _unhandled_input(event: InputEvent) -> void: human.stop_interaction() human.velocityVector = Vector2(0, 0) human.wants_to_grab = false human.wants_to_interact_with = null - if ( - event.is_action("move_left") or - event.is_action("move_right") or - event.is_action("move_up") or - event.is_action("move_down") - ): - human.velocityVector = Input.get_vector("move_left", "move_right", "move_up", "move_down") + human.velocityVector = Input.get_vector("move_left", "move_right", "move_up", "move_down") + if event.is_action_pressed("grab"): - if interactable: - human.wants_to_interact_with = interactable + if can_interact_with: + human.wants_to_interact_with = can_interact_with else: human.wants_to_grab = true @@ -38,10 +35,40 @@ func _process(delta) -> void: ray.target_position = Vector2(-48, 0) (ray.shape as RectangleShape2D).size = Vector2(20, 50) - interactable = null + # find all the possible interactables + possible_interactables = [] if ray.is_colliding(): var nbCollisions = ray.get_collision_count() for n in range(nbCollisions): var colider = ray.get_collider(n) as Node2D if colider != null and colider != get_parent(): - interactable = colider + if ( + colider and colider.get_parent().has_method("start_interaction") and + colider.get_parent().has_method("enable_interaction_clue") and + colider.get_parent().has_method("disable_interaction_clue") + ): + possible_interactables.append(colider.get_parent()) + + # find the closest interactable + var distance_to_closest = Vector2(0, 0) + var closest: Node2D = null + for potential_closest in possible_interactables: + var distance_to_human = abs(potential_closest.global_position - human.global_position) + + if distance_to_closest == Vector2(0, 0): + distance_to_closest = distance_to_human + closest = potential_closest + if distance_to_human < distance_to_closest: + closest = potential_closest + distance_to_closest = distance_to_human + + # if the new closest is different from the one we had before, notify the one we had before that it shouldn't keep its bubble visible + if can_interact_with != null: + if can_interact_with != closest: + can_interact_with.get_children() + can_interact_with.disable_interaction_clue() + # don't retrigger enabling the clue if it was already enabled + if can_interact_with != closest: + can_interact_with = closest + if can_interact_with: + can_interact_with.enable_interaction_clue() diff --git a/interactable/interaction_zone.gd b/interactable/interaction_zone.gd new file mode 100644 index 0000000..44010c5 --- /dev/null +++ b/interactable/interaction_zone.gd @@ -0,0 +1,12 @@ +extends Area2D +class_name InteractionZone + +@export var clue: Clue + +func enable_interaction_clue(): + if clue: + clue.setVisible(true) + +func disable_interaction_clue(): + if clue: + clue.setVisible(false) diff --git a/interactable/interaction_zone.tscn b/interactable/interaction_zone.tscn new file mode 100644 index 0000000..a1babc0 --- /dev/null +++ b/interactable/interaction_zone.tscn @@ -0,0 +1,8 @@ +[gd_scene load_steps=2 format=3 uid="uid://x2asns3kiqwg"] + +[ext_resource type="Script" path="res://interactable/interaction_zone.gd" id="1_gljn5"] + +[node name="interaction zone" type="Area2D"] +collision_layer = 8 +collision_mask = 8 +script = ExtResource("1_gljn5") diff --git a/scenes/start.tscn b/scenes/start.tscn index feccf15..7edb96c 100644 --- a/scenes/start.tscn +++ b/scenes/start.tscn @@ -28,7 +28,7 @@ position = Vector2(-333, -262) [node name="movibles" type="Node2D" parent="."] [node name="player" parent="movibles" instance=ExtResource("2_5x6b5")] -position = Vector2(-3964, -20) +position = Vector2(-107, -161) [node name="cars" type="Node" parent="movibles"] diff --git a/zindex/ZIndexControler.tscn b/zindex/ZIndexControler.tscn index 853e304..299f65c 100644 --- a/zindex/ZIndexControler.tscn +++ b/zindex/ZIndexControler.tscn @@ -6,5 +6,6 @@ script = ExtResource("1_fn0ft") [node name="debugLabel" type="Label" parent="."] +visible = false offset_right = 40.0 offset_bottom = 23.0