diff --git a/art/interact_button.png b/art/interact_button.png new file mode 100644 index 0000000..34b39c3 Binary files /dev/null and b/art/interact_button.png differ diff --git a/art/interact_button.png.import b/art/interact_button.png.import new file mode 100644 index 0000000..0dcee82 --- /dev/null +++ b/art/interact_button.png.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://d0cd1alr8k706" +path="res://.godot/imported/interact_button.png-3356a9459d993b6fc378d0efcbed3cae.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://art/interact_button.png" +dest_files=["res://.godot/imported/interact_button.png-3356a9459d993b6fc378d0efcbed3cae.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/high_quality_mode=0 +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +mipmaps/preserve_alpha_test_coverage=false +mipmaps/alpha_test_threshold=0.5 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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/interactable.gd b/interactable.gd index 242195d..d2d729a 100644 --- a/interactable.gd +++ b/interactable.gd @@ -30,8 +30,10 @@ func _on_approach(body) -> void: if body!=%Player2D: return is_interactable = true + $Sprite2D/ButtonPrompt.show() func _on_abandon(body) -> void: if body!=%Player2D: return is_interactable = false + $Sprite2D/ButtonPrompt.hide() diff --git a/pharaoh.tscn b/pharaoh.tscn index 2e85a14..0b9ec3e 100644 --- a/pharaoh.tscn +++ b/pharaoh.tscn @@ -2,6 +2,7 @@ [ext_resource type="Script" uid="uid://bh588bpddschq" path="res://pharaoh.gd" id="1_mt7kg"] [ext_resource type="Texture2D" uid="uid://b2nldodte5p6s" path="res://art/sarco_closed.png" id="2_mt7kg"] +[ext_resource type="Texture2D" uid="uid://d0cd1alr8k706" path="res://art/interact_button.png" id="3_6vea8"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_eumkw"] size = Vector2(26, 32) @@ -18,6 +19,12 @@ texture = ExtResource("2_mt7kg") [node name="CollisionShape2D" type="CollisionShape2D" parent="Sprite2D/Area2D" unique_id=1560168165] shape = SubResource("RectangleShape2D_eumkw") +[node name="ButtonPrompt" type="Sprite2D" parent="Sprite2D" unique_id=1864817335] +visible = false +position = Vector2(0, -24) +scale = Vector2(0.8, 0.8) +texture = ExtResource("3_6vea8") + [connection signal="interacted" from="." to="." method="_on_interacted"] [connection signal="body_entered" from="Sprite2D/Area2D" to="." method="_on_approach"] [connection signal="body_exited" from="Sprite2D/Area2D" to="." method="_on_abandon"] diff --git a/player_2d.gd b/player_2d.gd index 95a77f5..2f595b3 100644 --- a/player_2d.gd +++ b/player_2d.gd @@ -178,8 +178,9 @@ func _process(delta: float) -> void: $Sprite2D/HatSprite.play("idle") $Parallax2D/Sprite2D.modulate = BACKGROUND_COLOR - for hidden_object in get_tree().get_nodes_in_group("Hidden"): - hidden_object.hide() + if get_tree(): + for hidden_object in get_tree().get_nodes_in_group("Hidden"): + hidden_object.hide() #Falling to death. if position.y >= death_threshold: diff --git a/world.tscn b/world.tscn index 2b6a46a..fe6ddd2 100644 --- a/world.tscn +++ b/world.tscn @@ -46,6 +46,58 @@ position = Vector2(-62, -24.616333) [node name="Tutorial" type="Node2D" parent="." unique_id=1391494772] +[node name="Block2" parent="Tutorial" unique_id=878186522 instance=ExtResource("2_036b0")] +position = Vector2(55, 118) + +[node name="LongBlock3" parent="Tutorial" unique_id=1035095840 instance=ExtResource("3_dwbse")] +position = Vector2(950, 505.12885) + +[node name="VerticalLongBlock2" parent="Tutorial" unique_id=1984351408 instance=ExtResource("4_pkg7o")] +position = Vector2(1695, 192.9927) + +[node name="VerticalLongBlock3" parent="Tutorial" unique_id=485343370 instance=ExtResource("4_pkg7o")] +position = Vector2(1695, 81.72651) + +[node name="VerticalLongBlock4" parent="Tutorial" unique_id=977741022 instance=ExtResource("4_pkg7o")] +position = Vector2(1589, 139.82124) + +[node name="VerticalLongBlock5" parent="Tutorial" unique_id=923671040 instance=ExtResource("4_pkg7o")] +position = Vector2(1589, 29.539703) + +[node name="Spike24" parent="Tutorial" unique_id=741914042 instance=ExtResource("12_k3n1d")] +position = Vector2(954, 520.88336) +rotation = -3.1415925 + +[node name="Spike25" parent="Tutorial" unique_id=1430493985 instance=ExtResource("12_k3n1d")] +position = Vector2(1827, 418.47906) +rotation = -3.1415925 + +[node name="Spike26" parent="Tutorial" unique_id=1849441610 instance=ExtResource("12_k3n1d")] +position = Vector2(1812, 418.47906) +rotation = -3.1415925 + +[node name="Spike27" parent="Tutorial" unique_id=102008874 instance=ExtResource("12_k3n1d")] +position = Vector2(1797, 418.47906) +rotation = -3.1415925 + +[node name="Spike28" parent="Tutorial" unique_id=1200843252 instance=ExtResource("12_k3n1d")] +position = Vector2(1871, 418.4791) +rotation = -3.1415925 + +[node name="LongBlock12" parent="Tutorial" unique_id=1003210040 instance=ExtResource("3_dwbse")] +position = Vector2(1299, 539.5918) + +[node name="Spike29" parent="Tutorial" unique_id=1503247741 instance=ExtResource("12_k3n1d")] +position = Vector2(1303, 555.34625) +rotation = -3.1415925 + +[node name="LongBlock13" parent="Tutorial" unique_id=483038350 instance=ExtResource("3_dwbse")] +position = Vector2(1837, 628.21094) + +[node name="Spike30" parent="Tutorial" unique_id=1550792049 instance=ExtResource("12_k3n1d")] +position = Vector2(1841, 643.96545) +rotation = -3.1415925 + [node name="LongBlock7" parent="Tutorial" unique_id=1405051006 instance=ExtResource("6_dwbse")] position = Vector2(1946, 401.7399) @@ -310,73 +362,18 @@ rotation = 4.712389 position = Vector2(1679, 181.17683) rotation = 4.712389 -[node name="ZoeLevel" type="Node2D" parent="." unique_id=980267417] -visible = false - -[node name="LongBlock4" parent="ZoeLevel" unique_id=469408536 instance=ExtResource("6_dwbse")] +[node name="LongBlock4" parent="Tutorial" unique_id=469408536 instance=ExtResource("6_dwbse")] position = Vector2(544, 399) -[node name="LongBlock5" parent="ZoeLevel" unique_id=1807703449 instance=ExtResource("6_dwbse")] +[node name="LongBlock5" parent="Tutorial" unique_id=1807703449 instance=ExtResource("6_dwbse")] position = Vector2(880, 399) -[node name="LongBlock6" parent="ZoeLevel" unique_id=1328813509 instance=ExtResource("6_dwbse")] +[node name="LongBlock6" parent="Tutorial" unique_id=1328813509 instance=ExtResource("6_dwbse")] position = Vector2(1368, 401) -[node name="LongBlock7" parent="ZoeLevel" unique_id=1016724328 instance=ExtResource("6_dwbse")] +[node name="LongBlock11" parent="Tutorial" unique_id=1016724328 instance=ExtResource("6_dwbse")] position = Vector2(1149, 629.44025) -[node name="Block" parent="ZoeLevel" unique_id=878186522 instance=ExtResource("2_036b0")] -position = Vector2(55, 118) - -[node name="LongBlock" parent="ZoeLevel" unique_id=1035095840 instance=ExtResource("3_dwbse")] -position = Vector2(950, 505.12885) - -[node name="VerticalLongBlock" parent="ZoeLevel" unique_id=1984351408 instance=ExtResource("4_pkg7o")] -position = Vector2(1695, 192.9927) - -[node name="VerticalLongBlock2" parent="ZoeLevel" unique_id=485343370 instance=ExtResource("4_pkg7o")] -position = Vector2(1695, 81.72651) - -[node name="VerticalLongBlock3" parent="ZoeLevel" unique_id=977741022 instance=ExtResource("4_pkg7o")] -position = Vector2(1589, 139.82124) - -[node name="VerticalLongBlock4" parent="ZoeLevel" unique_id=923671040 instance=ExtResource("4_pkg7o")] -position = Vector2(1589, 29.539703) - -[node name="Spike" parent="ZoeLevel" unique_id=741914042 instance=ExtResource("12_k3n1d")] -position = Vector2(954, 520.88336) -rotation = 3.1415927 - -[node name="Spike4" parent="ZoeLevel" unique_id=1430493985 instance=ExtResource("12_k3n1d")] -position = Vector2(1827, 418.47906) -rotation = 3.1415927 - -[node name="Spike5" parent="ZoeLevel" unique_id=1849441610 instance=ExtResource("12_k3n1d")] -position = Vector2(1812, 418.47906) -rotation = 3.1415927 - -[node name="Spike6" parent="ZoeLevel" unique_id=102008874 instance=ExtResource("12_k3n1d")] -position = Vector2(1797, 418.47906) -rotation = 3.1415927 - -[node name="Spike7" parent="ZoeLevel" unique_id=1200843252 instance=ExtResource("12_k3n1d")] -position = Vector2(1871, 418.4791) -rotation = 3.1415927 - -[node name="LongBlock2" parent="ZoeLevel" unique_id=1003210040 instance=ExtResource("3_dwbse")] -position = Vector2(1299, 539.5918) - -[node name="Spike2" parent="ZoeLevel" unique_id=1503247741 instance=ExtResource("12_k3n1d")] -position = Vector2(1303, 555.3463) -rotation = 3.1415927 - -[node name="LongBlock3" parent="ZoeLevel" unique_id=483038350 instance=ExtResource("3_dwbse")] -position = Vector2(1837, 628.21094) - -[node name="Spike3" parent="ZoeLevel" unique_id=1550792049 instance=ExtResource("12_k3n1d")] -position = Vector2(1841, 643.96545) -rotation = 3.1415927 - [node name="CanvasLayer" type="CanvasLayer" parent="." unique_id=1637221343] [node name="RichTextLabel2" type="RichTextLabel" parent="CanvasLayer" unique_id=1254950785] @@ -447,7 +444,6 @@ position = Vector2(6338, -58.09474) [node name="OldComputer" parent="." unique_id=1951254108 instance=ExtResource("19_cbp6q")] unique_name_in_owner = true -visible = false [node name="Block" parent="." unique_id=226580978 instance=ExtResource("2_036b0")] position = Vector2(6637, -253.12886)