diff --git a/client/Nodes/GUI.tscn b/client/Nodes/GUI.tscn new file mode 100644 index 0000000..4b00395 --- /dev/null +++ b/client/Nodes/GUI.tscn @@ -0,0 +1,139 @@ +[gd_scene load_steps=9 format=2] + +[ext_resource path="res://Assets/Themes/default.tres" type="Theme" id=1] +[ext_resource path="res://Scripts/Systems/GameGui.gd" type="Script" id=2] +[ext_resource path="res://Assets/Proprietary/hf-scifi-complete/zapper-v1.1/Zapper.ttf" type="DynamicFontData" id=3] +[ext_resource path="res://Assets/Proprietary/hf-scifi-complete/zapper-v1.1/Zapper.otf" type="DynamicFontData" id=4] +[ext_resource path="res://Assets/Proprietary/hf-scifi-complete/targets-v3.1/Targets.ttf" type="DynamicFontData" id=5] + +[sub_resource type="DynamicFont" id=2] +size = 18 +font_data = ExtResource( 5 ) + +[sub_resource type="DynamicFont" id=17] +size = 48 +font_data = ExtResource( 3 ) + +[sub_resource type="DynamicFont" id=18] +size = 32 +outline_size = 1 +outline_color = Color( 0, 0, 0, 1 ) +font_data = ExtResource( 4 ) + +[node name="GUI" type="CanvasLayer"] +script = ExtResource( 2 ) + +[node name="Dialog" type="Control" parent="."] +visible = false +anchor_left = 0.5 +anchor_top = 1.0 +anchor_right = 0.5 +anchor_bottom = 1.0 +margin_left = -512.0 +margin_top = -173.0 +margin_right = 512.0 +theme = ExtResource( 1 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Textbox" type="ColorRect" parent="Dialog"] +anchor_left = 0.5 +anchor_top = 1.0 +anchor_right = 0.5 +anchor_bottom = 1.0 +margin_left = -475.0 +margin_top = -143.0 +margin_right = 475.0 +margin_bottom = -20.0 +color = Color( 0.254902, 0.513726, 0.505882, 0.870588 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Speaker" type="Label" parent="Dialog/Textbox"] +margin_left = 12.0 +margin_top = 8.0 +margin_right = 594.0 +margin_bottom = 34.0 +text = "Speaker" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Body" type="Label" parent="Dialog/Textbox"] +anchor_top = 0.5 +anchor_right = 1.0 +anchor_bottom = 0.5 +margin_left = 12.0 +margin_top = -16.5 +margin_right = -39.0 +margin_bottom = 49.5 +custom_fonts/font = SubResource( 2 ) +text = "Hello world!" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Choices" type="HBoxContainer" parent="Dialog"] +visible = false +anchor_left = 0.5 +anchor_top = 1.0 +anchor_right = 0.5 +anchor_bottom = 1.0 +margin_left = -472.0 +margin_top = -172.0 +margin_right = 472.0 +margin_bottom = -148.0 +alignment = 1 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Button" type="Button" parent="Dialog/Choices"] +margin_left = 297.0 +margin_right = 371.0 +margin_bottom = 26.0 +text = "Choice" + +[node name="Button2" type="Button" parent="Dialog/Choices"] +margin_left = 435.0 +margin_right = 509.0 +margin_bottom = 26.0 +text = "Choice" + +[node name="Button3" type="Button" parent="Dialog/Choices"] +margin_left = 573.0 +margin_right = 647.0 +margin_bottom = 26.0 +text = "Choice" + +[node name="ZoneLabel" type="Label" parent="."] +anchor_top = 1.0 +anchor_bottom = 1.0 +margin_left = 12.0 +margin_top = -59.0 +margin_right = 1257.0 +margin_bottom = -8.0 +custom_fonts/font = SubResource( 17 ) +text = "Entering: Depths" +valign = 2 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Tip" type="Label" parent="."] +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -386.0 +margin_top = -110.5 +margin_right = 386.0 +margin_bottom = 110.5 +custom_fonts/font = SubResource( 18 ) +text = "Press WASD to move" +align = 1 +__meta__ = { +"_edit_use_anchors_": false +} diff --git a/client/Nodes/Player.tscn b/client/Nodes/Player.tscn index 7f4b2d4..f387948 100644 --- a/client/Nodes/Player.tscn +++ b/client/Nodes/Player.tscn @@ -21,7 +21,7 @@ region = Rect2( 2, 6, 1, 1 ) [sub_resource type="AtlasTexture" id=3] flags = 8 atlas = ExtResource( 2 ) -region = Rect2( 1, 1, 3, 4 ) +region = Rect2( 1, 1, 4, 4 ) [sub_resource type="AtlasTexture" id=4] flags = 8 @@ -699,6 +699,7 @@ __meta__ = { material = ExtResource( 1 ) position = Vector2( 0, -2.25 ) texture = SubResource( 3 ) +offset = Vector2( 0.5, 0 ) __meta__ = { "_edit_bone_": true } diff --git a/client/Scenes/Dev.tscn b/client/Scenes/Dev.tscn new file mode 100644 index 0000000..430b77e --- /dev/null +++ b/client/Scenes/Dev.tscn @@ -0,0 +1,27 @@ +[gd_scene load_steps=6 format=2] + +[ext_resource path="res://Nodes/Tiles/tileset_science_lab.tres" type="TileSet" id=1] +[ext_resource path="res://Nodes/NPCs/CEO.tscn" type="PackedScene" id=2] +[ext_resource path="res://Nodes/Player.tscn" type="PackedScene" id=3] +[ext_resource path="res://Nodes/GUI.tscn" type="PackedScene" id=4] +[ext_resource path="res://Nodes/NPCs/Thadd.tscn" type="PackedScene" id=5] + +[node name="World" type="Node2D"] + +[node name="TileMap" type="TileMap" parent="."] +tile_set = ExtResource( 1 ) +cell_size = Vector2( 16, 16 ) +format = 1 +tile_data = PoolIntArray( 720897, 47, 0, 720898, 47, 1, 720899, 47, 1, 720900, 47, 1, 720901, 47, 1, 720902, 47, 1, 720903, 47, 1, 720904, 47, 1, 720905, 47, 1, 720906, 47, 1, 720907, 47, 1, 720908, 47, 1, 720909, 47, 1, 720910, 47, 1, 720911, 47, 1, 720912, 47, 1, 720913, 47, 1, 720914, 47, 1, 720915, 47, 1, 720916, 47, 1, 720917, 47, 1, 720918, 47, 1, 720919, 47, 1, 720920, 47, 1, 720921, 47, 1, 720922, 47, 1, 720923, 47, 1, 720924, 47, 1, 720925, 47, 1, 720926, 47, 1, 720927, 47, 2, 786433, 47, 65536, 786434, 47, 65537, 786435, 47, 65537, 786436, 47, 65537, 786437, 47, 65537, 786438, 47, 65537, 786439, 47, 65537, 786440, 47, 65537, 786441, 47, 65537, 786442, 47, 65537, 786443, 47, 65537, 786444, 47, 65537, 786445, 47, 65537, 786446, 47, 65537, 786447, 47, 65537, 786448, 47, 65537, 786449, 47, 65537, 786450, 47, 65537, 786451, 47, 65537, 786452, 47, 65537, 786453, 47, 65537, 786454, 47, 65537, 786455, 47, 65537, 786456, 47, 65537, 786457, 47, 65537, 786458, 47, 65537, 786459, 47, 65537, 786460, 47, 65537, 786461, 47, 65537, 786462, 47, 65537, 786463, 47, 65538, 851969, 47, 131072, 851970, 47, 131073, 851971, 47, 131073, 851972, 47, 131073, 851973, 47, 131073, 851974, 47, 131073, 851975, 47, 131073, 851976, 47, 131073, 851977, 47, 131073, 851978, 47, 131073, 851979, 47, 131073, 851980, 47, 131073, 851981, 47, 131073, 851982, 47, 131073, 851983, 47, 131073, 851984, 47, 131073, 851985, 47, 131073, 851986, 47, 131073, 851987, 47, 131073, 851988, 47, 131073, 851989, 47, 131073, 851990, 47, 131073, 851991, 47, 131073, 851992, 47, 131073, 851993, 47, 131073, 851994, 47, 131073, 851995, 47, 131073, 851996, 47, 131073, 851997, 47, 131073, 851998, 47, 131073, 851999, 47, 131074 ) + +[node name="Scientist" parent="." instance=ExtResource( 2 )] +position = Vector2( 182.674, 166.939 ) + +[node name="Player" parent="." instance=ExtResource( 3 )] +position = Vector2( 90.0225, 142.418 ) + +[node name="GUI" parent="." instance=ExtResource( 4 )] + +[node name="Scientist2" parent="." instance=ExtResource( 5 )] +position = Vector2( 139.806, 168.653 ) +start_on_play = false diff --git a/client/Scenes/World.scn b/client/Scenes/World.scn index 45cb7d3..b2d5cef 100644 Binary files a/client/Scenes/World.scn and b/client/Scenes/World.scn differ diff --git a/client/Scripts/Component/Speaker.gd b/client/Scripts/Component/Speaker.gd index f58c0d8..01f0085 100644 --- a/client/Scripts/Component/Speaker.gd +++ b/client/Scripts/Component/Speaker.gd @@ -63,8 +63,9 @@ func play_audio(): else: playing_speech = false if len(soundQueue) == 0: - emit_signal("finished_text") - done = true + if not done: + emit_signal("finished_text") + done = true func del_obj(obj): obj.queue_free() diff --git a/client/Scripts/Entities/NPCs/IntroScientist.gd b/client/Scripts/Entities/NPCs/IntroScientist.gd index 15b493d..9f39517 100644 --- a/client/Scripts/Entities/NPCs/IntroScientist.gd +++ b/client/Scripts/Entities/NPCs/IntroScientist.gd @@ -1,11 +1,14 @@ extends "res://Scripts/Component/Interactable.gd" +export var start_on_play = true + func _ready(): connect("interacted", self, "_on_interact") $Speaker.speaker = "fast_talker" $Speaker.speaker_name = "Dr.Thadd" $Speaker.connect("dialog_exited", self, "give_tip") - $Speaker.start_dialog("intro_science") + if start_on_play: + $Speaker.start_dialog("intro_science") func _on_interact(): $Speaker.start_dialog("intro_science_followup")