diff --git a/Dialogue.tscn b/Dialogue.tscn new file mode 100644 index 0000000..46fabd0 --- /dev/null +++ b/Dialogue.tscn @@ -0,0 +1,39 @@ +[gd_scene format=3 uid="uid://bla1cfndgad0"] + +[ext_resource type="Script" uid="uid://byj4ibepgm6oa" path="res://dialogue.gd" id="1_tgtc2"] + +[node name="Dialogue" type="Control" unique_id=1025022375] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_tgtc2") + +[node name="Panel" type="Panel" parent="." unique_id=1878574619] +layout_mode = 1 +anchors_preset = -1 +anchor_left = 0.179 +anchor_top = 0.683 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = -230.12001 +offset_top = -493.76 +offset_right = -230.0 +offset_bottom = -494.0 +grow_horizontal = 0 +grow_vertical = 0 + +[node name="Text" type="RichTextLabel" parent="Panel" unique_id=1494828842] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = 8.0 +offset_top = 11.0 +offset_right = -11.0 +offset_bottom = 4.0 +grow_horizontal = 2 +grow_vertical = 2 +bbcode_enabled = true diff --git a/OldComputer.tscn b/OldComputer.tscn index 7cf4d16..719c285 100644 --- a/OldComputer.tscn +++ b/OldComputer.tscn @@ -43,6 +43,7 @@ offset_left = 150.0 offset_top = 105.0 offset_right = 1102.0 offset_bottom = 652.0 +bbcode_enabled = true text = ">> Pharaoh OS 2000 Boot Sequence >> WARN: Detected anomalies! >> WARN: Memory integrity at %d%%! diff --git a/dialogue.gd b/dialogue.gd new file mode 100644 index 0000000..ee6c768 --- /dev/null +++ b/dialogue.gd @@ -0,0 +1,15 @@ +class_name Dialogue +extends Control + +func show_text(text: String) -> Dialogue: + visible = true + $Panel/Text.text = "[font_size=28]%s" % text + return self + +func dismiss_after(secs: float) -> Dialogue: + await get_tree().create_timer(secs).timeout + return dismiss() + +func dismiss() -> Dialogue: + visible = false + return self diff --git a/dialogue.gd.uid b/dialogue.gd.uid new file mode 100644 index 0000000..f7b8ea7 --- /dev/null +++ b/dialogue.gd.uid @@ -0,0 +1 @@ +uid://byj4ibepgm6oa diff --git a/pharaoh.gd b/pharaoh.gd index 7e3cb08..c3d369a 100644 --- a/pharaoh.gd +++ b/pharaoh.gd @@ -3,31 +3,22 @@ extends Interactable func _on_interacted() -> void: #%OldComputer.open() - if %Player2D.spawn_point != global_position: - %Player2D.spawn_point = global_position - %OldComputer.printline(">> Respawn point set.") - #Accomodate some collision antics. - %Player2D.spawn_point = global_position + Vector2(0,-10) + var new_spawn_point = global_position + Vector2(0,-10) + + if %Player2D.spawn_point != new_spawn_point: + %Player2D.spawn_point = new_spawn_point + %OldComputer.printline(">> Respawn point set to %s" % new_spawn_point) var wanted_disk = %OldComputer.get_next_disk_num() - if not %Player2D.take_disk(wanted_disk): - if wanted_disk == 1 and not %Player2D.has_objective("disk%d" % wanted_disk): - %OldComputer.open() - %Player2D.give_objective( - "disk%d" % wanted_disk, - wanted_disk, "Locate data disk %d" % wanted_disk - ) - return - if %Player2D.complete_objective("sarc"): %OldComputer.open() %Player2D.give_objective( "disk%d" % wanted_disk, wanted_disk, "Locate data disk %d" % wanted_disk ) - return + return if not (%Player2D.take_disk(wanted_disk) and %OldComputer.load_disk(wanted_disk)): return diff --git a/player_2d.gd b/player_2d.gd index a73afb7..b23e03e 100644 --- a/player_2d.gd +++ b/player_2d.gd @@ -26,6 +26,7 @@ func _ready() -> void: spawn_point = position DisplayServer.window_set_title("JUMPS EQUALS JUMPS") give_objective("sarc", 0, "Open the Sarcophagus") + %Dialogue.show_text("Hello world!").dismiss_after(2) func refresh_dash(new_dashes): if new_dashes: diff --git a/world.tscn b/world.tscn index f6279d4..87e7b87 100644 --- a/world.tscn +++ b/world.tscn @@ -18,6 +18,7 @@ [ext_resource type="Script" uid="uid://d3rx82psovcpp" path="res://music_button.gd" id="14_70uel"] [ext_resource type="Script" uid="uid://oyyhhy1gemg0" path="res://objectives_label.gd" id="14_ikiii"] [ext_resource type="PackedScene" uid="uid://dr8h8xij3qw2h" path="res://pharaoh.tscn" id="15_hiqwa"] +[ext_resource type="PackedScene" uid="uid://bla1cfndgad0" path="res://Dialogue.tscn" id="19_26xuy"] [ext_resource type="PackedScene" uid="uid://bcu7ftukipiyy" path="res://OldComputer.tscn" id="19_cbp6q"] [ext_resource type="PackedScene" uid="uid://b5ssjxl1l3fx0" path="res://hidden_vertical_long_block.tscn" id="20_26xuy"] [ext_resource type="PackedScene" uid="uid://ch0417iiviaxb" path="res://hidden_horizontal_long_block.tscn" id="21_bc84e"] @@ -31,6 +32,7 @@ scale = Vector2(1, 1.0155824) unique_name_in_owner = true position = Vector2(-4844.9995, 356.44568) rotation = 0.0005533503 +safe_margin = 0.08 [node name="StartingArea" type="Node2D" parent="." unique_id=130240736] position = Vector2(-4673, 390.9087) @@ -433,8 +435,9 @@ script = ExtResource("3_wse8f") anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 -offset_top = 605.0 -offset_bottom = 274.0 +offset_top = 586.0 +offset_right = -1097.0 +offset_bottom = 2.0 grow_horizontal = 2 grow_vertical = 2 bbcode_enabled = true @@ -461,13 +464,18 @@ texture_pressed = ExtResource("13_70uel") texture_disabled = ExtResource("13_70uel") script = ExtResource("14_70uel") -[node name="Pharaoh" parent="." unique_id=44054531 instance=ExtResource("15_hiqwa")] +[node name="Dialogue" parent="CanvasLayer" unique_id=1025022375 instance=ExtResource("19_26xuy")] unique_name_in_owner = true -position = Vector2(55, 111.266205) +offset_left = 228.0 +offset_top = 499.0 +offset_right = 231.0 +offset_bottom = 491.0 rotation = 4.9367074e-05 +[node name="Pharaoh" parent="." unique_id=44054531 instance=ExtResource("15_hiqwa")] +position = Vector2(192, 177.23824) + [node name="Pharaoh2" parent="." unique_id=1541178727 instance=ExtResource("15_hiqwa")] -unique_name_in_owner = true position = Vector2(6338, -42.34024) [node name="OldComputer" parent="." unique_id=1951254108 instance=ExtResource("19_cbp6q")]