Add main scene
All checks were successful
/ test (push) Successful in 1s

This commit is contained in:
Antonio Dell'Annunziata 2025-03-03 06:21:38 +01:00
parent d99381ad54
commit 7ef763605e
No known key found for this signature in database
GPG key ID: 8D2BB16641F06E94
45 changed files with 240 additions and 62 deletions

60
dialog.gd Normal file
View file

@ -0,0 +1,60 @@
class_name Dialog
extends Node2D
signal dialog_finished
@onready var text_box_label: RichTextLabel = %TextBoxLabel
const SPEED_SLOW = 5.0
const SPEED_NORMAL = 10.0
const SPEED_FAST = 15.0
var dialog_text: Array[Dictionary] = [
{speaker = "?", text = "...", speed = SPEED_SLOW},
{speaker = "Necra", text = "Hello?"},
{speaker = "?", text = "!", speed = SPEED_SLOW},
{speaker = "Necra", text = "Can... can I help you?", speed = SPEED_SLOW},
{speaker = "?", text = "EEEEEEHHHsh...", speed = SPEED_SLOW},
{speaker = "?", text = "*Cough* Sorry, my vocal cords are rusty. Yes.", speed = SPEED_FAST},
{speaker = "Bob", text = "I am Bob. There is a bat in my chest. Can you remove it?"},
{speaker = "Necra", text = "How did that... on second thought, nevermind."},
]
var current_line = 0
func _ready():
text_box_label.text = ""
$Undead.modulate = Color(1.0,1.0,1.0,0)
next_line()
func _input(event):
if event is InputEventKey and event.key_label == KEY_SPACE and event.is_released():
next_line()
var tween: Tween
func next_line():
if not text_box_label.visible: return
if current_line >= dialog_text.size():
dialog_finished.emit()
text_box_label.hide()
return
if current_line == 0:
create_tween().tween_property($Undead, "modulate", Color(1.0,1.0,1.0, .1), 1)
if current_line == 2:
create_tween().tween_property($Undead, "modulate", Color(1.0,1.0,1.0, .2), 1)
if current_line == 4:
create_tween().tween_property($Undead, "modulate", Color(1.0,1.0,1.0, .5), 1)
if current_line == 5:
create_tween().tween_property($Undead, "modulate", Color(1.0,1.0,1.0, 1), .2)
var next = dialog_text[current_line]
text_box_label.text = "%s: %s" % [next["speaker"], next["text"]]
text_box_label.visible_characters = next["speaker"].length() + 2
var remaining_characters = text_box_label.text.length() - text_box_label.visible_characters
var tween_duration = remaining_characters / (next["speed"] if next.has("speed") else SPEED_NORMAL)
if tween:
tween.kill()
tween = create_tween()
tween.tween_property(text_box_label, "visible_characters", text_box_label.text.length(), tween_duration)
current_line += 1

16
main.gd Normal file
View file

@ -0,0 +1,16 @@
extends Node2D
@onready var room: Node2D = $Room
@onready var dialog: Dialog = $Dialog
func _ready():
room.hide()
room.set_deferred("process", false)
dialog.dialog_finished.connect(_on_dialog_finished)
func _on_dialog_finished():
dialog.hide()
dialog.set_deferred("process", false)
room.set_deferred("process", true)
room.show()

102
main.tscn Normal file
View file

@ -0,0 +1,102 @@
[gd_scene load_steps=9 format=3 uid="uid://w3ntt1yh1nq7"]
[ext_resource type="Script" path="res://dialog.gd" id="1_0qabl"]
[ext_resource type="Script" path="res://main.gd" id="1_dp5o4"]
[sub_resource type="Gradient" id="Gradient_cuqb1"]
offsets = PackedFloat32Array(0)
colors = PackedColorArray(0, 0, 0, 1)
[sub_resource type="GradientTexture1D" id="GradientTexture1D_30ci2"]
gradient = SubResource("Gradient_cuqb1")
width = 1152
[sub_resource type="Gradient" id="Gradient_i35qq"]
offsets = PackedFloat32Array(0.159011)
colors = PackedColorArray(0.344076, 0.344076, 0.344076, 1)
[sub_resource type="GradientTexture2D" id="GradientTexture2D_4lgr0"]
gradient = SubResource("Gradient_i35qq")
width = 200
height = 400
fill_from = Vector2(0.5, 0)
fill_to = Vector2(0.5, 1)
[sub_resource type="Gradient" id="Gradient_qkope"]
offsets = PackedFloat32Array(0)
colors = PackedColorArray(0.466181, 0.466181, 0.466181, 1)
[sub_resource type="GradientTexture1D" id="GradientTexture1D_p6qcv"]
gradient = SubResource("Gradient_qkope")
width = 1152
[node name="Main" type="Node2D"]
script = ExtResource("1_dp5o4")
[node name="UI" type="Control" parent="."]
top_level = true
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="TextBox" type="MarginContainer" parent="UI"]
layout_mode = 1
anchors_preset = 7
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
offset_left = -259.0
offset_top = -33.0
offset_right = 259.0
grow_horizontal = 2
grow_vertical = 0
theme_override_constants/margin_left = 5
theme_override_constants/margin_top = 5
theme_override_constants/margin_right = 5
theme_override_constants/margin_bottom = 5
[node name="TextBoxLabel" type="RichTextLabel" parent="UI/TextBox"]
unique_name_in_owner = true
layout_mode = 2
text = "Test"
[node name="Dialog" type="Node2D" parent="."]
script = ExtResource("1_0qabl")
[node name="BlackBackground" type="Sprite2D" parent="Dialog"]
position = Vector2(576, 325.25)
scale = Vector2(1.001, 652)
texture = SubResource("GradientTexture1D_30ci2")
[node name="Undead" type="Sprite2D" parent="Dialog"]
position = Vector2(587, 291)
texture = SubResource("GradientTexture2D_4lgr0")
[node name="Label" type="Label" parent="Dialog/Undead"]
offset_left = -17.0
offset_top = -34.0
offset_right = 23.0
offset_bottom = -11.0
text = "Bob"
[node name="Room" type="Node2D" parent="."]
[node name="RoomBackground" type="Sprite2D" parent="Room"]
position = Vector2(576, 325.25)
scale = Vector2(1.001, 652)
texture = SubResource("GradientTexture1D_p6qcv")
[node name="Undead" type="Sprite2D" parent="Room"]
position = Vector2(237, 260)
scale = Vector2(0.5, 0.5)
texture = SubResource("GradientTexture2D_4lgr0")
[node name="Label" type="Label" parent="Room/Undead"]
offset_top = 2.0
offset_right = 40.0
offset_bottom = 25.0
text = "Bob"

View file

Before

Width:  |  Height:  |  Size: 880 B

After

Width:  |  Height:  |  Size: 880 B

View file

@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://ciy24ri5lusqs"
path="res://.godot/imported/bat_extraction_bat.png-b7feda81aca7e4664533f81acf13e93e.ctex"
path="res://.godot/imported/bat_extraction_bat.png-dbecb2195c630c933b3f1dfbb788ba50.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://bat_extraction_bat.png"
dest_files=["res://.godot/imported/bat_extraction_bat.png-b7feda81aca7e4664533f81acf13e93e.ctex"]
source_file="res://operation/bat_extraction_bat.png"
dest_files=["res://.godot/imported/bat_extraction_bat.png-dbecb2195c630c933b3f1dfbb788ba50.ctex"]
[params]

View file

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

View file

@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://dwjmlaw1vxgxo"
path="res://.godot/imported/bat_extraction_body.png-fbbc2f2b2905af68cd60de7d95642821.ctex"
path="res://.godot/imported/bat_extraction_body.png-78b485bc77a9fced2cb76f6b54169ea1.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://bat_extraction_body.png"
dest_files=["res://.godot/imported/bat_extraction_body.png-fbbc2f2b2905af68cd60de7d95642821.ctex"]
source_file="res://operation/bat_extraction_body.png"
dest_files=["res://.godot/imported/bat_extraction_body.png-78b485bc77a9fced2cb76f6b54169ea1.ctex"]
[params]

View file

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View file

@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://ljl3y4633ted"
path="res://.godot/imported/bat_extraction_bones.png-6faa1d70b9341cf58bf01769bbbf3e63.ctex"
path="res://.godot/imported/bat_extraction_bones.png-e4ab91a9055374b7e362ee906d0f9f1e.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://bat_extraction_bones.png"
dest_files=["res://.godot/imported/bat_extraction_bones.png-6faa1d70b9341cf58bf01769bbbf3e63.ctex"]
source_file="res://operation/bat_extraction_bones.png"
dest_files=["res://.godot/imported/bat_extraction_bones.png-e4ab91a9055374b7e362ee906d0f9f1e.ctex"]
[params]

View file

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View file

@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://bkjxp2r3pobmc"
path="res://.godot/imported/bat_extraction_open_chest.png-379c8db02a15a2a69eca2cd0493839cb.ctex"
path="res://.godot/imported/bat_extraction_open_chest.png-75796a209ed1b293519b8f928ce832a8.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://bat_extraction_open_chest.png"
dest_files=["res://.godot/imported/bat_extraction_open_chest.png-379c8db02a15a2a69eca2cd0493839cb.ctex"]
source_file="res://operation/bat_extraction_open_chest.png"
dest_files=["res://.godot/imported/bat_extraction_open_chest.png-75796a209ed1b293519b8f928ce832a8.ctex"]
[params]

View file

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View file

@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://n8x3g2swx0x2"
path="res://.godot/imported/bat_extraction_open_chest_flaps.png-76165f2a128f08425141a09803f6c2e2.ctex"
path="res://.godot/imported/bat_extraction_open_chest_flaps.png-28f7591d9acbb670a45019a6528b8793.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://bat_extraction_open_chest_flaps.png"
dest_files=["res://.godot/imported/bat_extraction_open_chest_flaps.png-76165f2a128f08425141a09803f6c2e2.ctex"]
source_file="res://operation/bat_extraction_open_chest_flaps.png"
dest_files=["res://.godot/imported/bat_extraction_open_chest_flaps.png-28f7591d9acbb670a45019a6528b8793.ctex"]
[params]

View file

@ -1,7 +1,7 @@
[gd_scene load_steps=4 format=3 uid="uid://x5powiwrfash"]
[ext_resource type="Texture2D" uid="uid://gf7us6an3mhu" path="res://test_star.png" id="1_o3e76"]
[ext_resource type="Script" path="res://cut_sequence_point.gd" id="2_um6ol"]
[ext_resource type="Texture2D" uid="uid://gf7us6an3mhu" path="res://operation/test_star.png" id="1_o3e76"]
[ext_resource type="Script" path="res://operation/cut_sequence_point.gd" id="2_um6ol"]
[sub_resource type="CircleShape2D" id="CircleShape2D_e2fuh"]
radius = 8.24621

View file

Before

Width:  |  Height:  |  Size: 994 B

After

Width:  |  Height:  |  Size: 994 B

View file

@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://crsa80t1aiiw0"
path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"
path="res://.godot/imported/icon.svg-de870066821249673c69b38821144159.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://icon.svg"
dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"]
source_file="res://operation/icon.svg"
dest_files=["res://.godot/imported/icon.svg-de870066821249673c69b38821144159.ctex"]
[params]

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://c3of67m4ic212"]
[ext_resource type="Script" path="res://pickup_area.gd" id="1_6qsiy"]
[ext_resource type="Script" path="res://operation/pickup_area.gd" id="1_6qsiy"]
[node name="PickupArea" type="Area2D"]
collision_layer = 2

View file

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View file

@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://ccy71gl4qatjy"
path="res://.godot/imported/pliers.png-851b2339f2c5c7c6c30da64e0b329620.ctex"
path="res://.godot/imported/pliers.png-b51aa4394692a2b713451e4aeee751ac.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://pliers.png"
dest_files=["res://.godot/imported/pliers.png-851b2339f2c5c7c6c30da64e0b329620.ctex"]
source_file="res://operation/pliers.png"
dest_files=["res://.godot/imported/pliers.png-b51aa4394692a2b713451e4aeee751ac.ctex"]
[params]

View file

@ -1,26 +1,26 @@
[gd_scene load_steps=31 format=3 uid="uid://be0rqt7sk1da0"]
[ext_resource type="Texture2D" uid="uid://bicjfwpoa3pma" path="res://test_table.png" id="1_7i8d4"]
[ext_resource type="Script" path="res://prototype_dark_cut.gd" id="1_vl0qk"]
[ext_resource type="Texture2D" uid="uid://bp10w3bh1gn14" path="res://test_body_1.png" id="2_atjyl"]
[ext_resource type="Texture2D" uid="uid://cg3dg7iqif56d" path="res://test_scalpel.png" id="3_a4jra"]
[ext_resource type="Script" path="res://bat_dropoff.gd" id="4_2wsdd"]
[ext_resource type="Script" path="res://test_scalpel.gd" id="4_5ba3g"]
[ext_resource type="Texture2D" uid="uid://ccy71gl4qatjy" path="res://pliers.png" id="4_aj8rk"]
[ext_resource type="Texture2D" uid="uid://bkjxp2r3pobmc" path="res://bat_extraction_open_chest.png" id="5_c2dn1"]
[ext_resource type="Script" path="res://pliers.gd" id="5_ewpkr"]
[ext_resource type="Texture2D" uid="uid://ciy24ri5lusqs" path="res://bat_extraction_bat.png" id="6_yfdwj"]
[ext_resource type="Texture2D" uid="uid://dwjmlaw1vxgxo" path="res://bat_extraction_body.png" id="7_7hv63"]
[ext_resource type="Script" path="res://operation.gd" id="7_mteqj"]
[ext_resource type="PackedScene" uid="uid://c3of67m4ic212" path="res://pickup_area.tscn" id="7_uhavf"]
[ext_resource type="Texture2D" uid="uid://n8x3g2swx0x2" path="res://bat_extraction_open_chest_flaps.png" id="8_1vja2"]
[ext_resource type="Shape2D" uid="uid://bo77ihhtxfueg" path="res://scalpel_pickup_area_collision_shape.tres" id="8_mvvp0"]
[ext_resource type="Script" path="res://feedback_canvas_modulate.gd" id="9_4ghh6"]
[ext_resource type="Texture2D" uid="uid://ljl3y4633ted" path="res://bat_extraction_bones.png" id="9_7uu43"]
[ext_resource type="Script" path="res://cut_sequence.gd" id="10_gcaa6"]
[ext_resource type="PackedScene" uid="uid://x5powiwrfash" path="res://cut_sequence_point.tscn" id="11_hcsao"]
[ext_resource type="Script" path="res://bat_extraction_bat.gd" id="13_um5dt"]
[ext_resource type="Script" path="res://grab_step.gd" id="18_d00rj"]
[ext_resource type="Texture2D" uid="uid://bicjfwpoa3pma" path="res://operation/test_table.png" id="1_7i8d4"]
[ext_resource type="Script" path="res://operation/prototype_dark_cut.gd" id="1_vl0qk"]
[ext_resource type="Texture2D" uid="uid://bp10w3bh1gn14" path="res://operation/test_body_1.png" id="2_atjyl"]
[ext_resource type="Texture2D" uid="uid://cg3dg7iqif56d" path="res://operation/test_scalpel.png" id="3_a4jra"]
[ext_resource type="Script" path="res://operation/bat_dropoff.gd" id="4_2wsdd"]
[ext_resource type="Script" path="res://operation/test_scalpel.gd" id="4_5ba3g"]
[ext_resource type="Texture2D" uid="uid://ccy71gl4qatjy" path="res://operation/pliers.png" id="4_aj8rk"]
[ext_resource type="Texture2D" uid="uid://bkjxp2r3pobmc" path="res://operation/bat_extraction_open_chest.png" id="5_c2dn1"]
[ext_resource type="Script" path="res://operation/pliers.gd" id="5_ewpkr"]
[ext_resource type="Texture2D" uid="uid://ciy24ri5lusqs" path="res://operation/bat_extraction_bat.png" id="6_yfdwj"]
[ext_resource type="Texture2D" uid="uid://dwjmlaw1vxgxo" path="res://operation/bat_extraction_body.png" id="7_7hv63"]
[ext_resource type="Script" path="res://operation/operation.gd" id="7_mteqj"]
[ext_resource type="PackedScene" uid="uid://c3of67m4ic212" path="res://operation/pickup_area.tscn" id="7_uhavf"]
[ext_resource type="Texture2D" uid="uid://n8x3g2swx0x2" path="res://operation/bat_extraction_open_chest_flaps.png" id="8_1vja2"]
[ext_resource type="Shape2D" uid="uid://bo77ihhtxfueg" path="res://operation/scalpel_pickup_area_collision_shape.tres" id="8_mvvp0"]
[ext_resource type="Script" path="res://operation/feedback_canvas_modulate.gd" id="9_4ghh6"]
[ext_resource type="Texture2D" uid="uid://ljl3y4633ted" path="res://operation/bat_extraction_bones.png" id="9_7uu43"]
[ext_resource type="Script" path="res://operation/cut_sequence.gd" id="10_gcaa6"]
[ext_resource type="PackedScene" uid="uid://x5powiwrfash" path="res://operation/cut_sequence_point.tscn" id="11_hcsao"]
[ext_resource type="Script" path="res://operation/bat_extraction_bat.gd" id="13_um5dt"]
[ext_resource type="Script" path="res://operation/grab_step.gd" id="18_d00rj"]
[sub_resource type="Gradient" id="Gradient_1s7o2"]
offsets = PackedFloat32Array(0.294915)

View file

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View file

@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://bp10w3bh1gn14"
path="res://.godot/imported/test_body_1.png-bad70dd27cee97e53ec48a91b30860ee.ctex"
path="res://.godot/imported/test_body_1.png-0cd2260c2a6ed319935cbe16e431cfbc.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://test_body_1.png"
dest_files=["res://.godot/imported/test_body_1.png-bad70dd27cee97e53ec48a91b30860ee.ctex"]
source_file="res://operation/test_body_1.png"
dest_files=["res://.godot/imported/test_body_1.png-0cd2260c2a6ed319935cbe16e431cfbc.ctex"]
[params]

View file

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View file

@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://b82j8773uke65"
path="res://.godot/imported/test_body_2.png-d7075535262222be1c971d9545bf8b7c.ctex"
path="res://.godot/imported/test_body_2.png-47d4d161a1da7b18f0b23fde7edd2909.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://test_body_2.png"
dest_files=["res://.godot/imported/test_body_2.png-d7075535262222be1c971d9545bf8b7c.ctex"]
source_file="res://operation/test_body_2.png"
dest_files=["res://.godot/imported/test_body_2.png-47d4d161a1da7b18f0b23fde7edd2909.ctex"]
[params]

View file

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

View file

@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://cg3dg7iqif56d"
path="res://.godot/imported/test_scalpel.png-f1e16fd2dbd02a77facc5974714c52cc.ctex"
path="res://.godot/imported/test_scalpel.png-b6a78c78d3794cf8c6a776be918893a1.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://test_scalpel.png"
dest_files=["res://.godot/imported/test_scalpel.png-f1e16fd2dbd02a77facc5974714c52cc.ctex"]
source_file="res://operation/test_scalpel.png"
dest_files=["res://.godot/imported/test_scalpel.png-b6a78c78d3794cf8c6a776be918893a1.ctex"]
[params]

View file

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://gf7us6an3mhu"
path="res://.godot/imported/test_star.png-120794e583f05130269660c1e753cd85.ctex"
path="res://.godot/imported/test_star.png-63e096360656fb43691ad658920eed9e.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://test_star.png"
dest_files=["res://.godot/imported/test_star.png-120794e583f05130269660c1e753cd85.ctex"]
source_file="res://operation/test_star.png"
dest_files=["res://.godot/imported/test_star.png-63e096360656fb43691ad658920eed9e.ctex"]
[params]

View file

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View file

@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://bicjfwpoa3pma"
path="res://.godot/imported/test_table.png-15007e285fb45460290ac1ad16f88048.ctex"
path="res://.godot/imported/test_table.png-ed3e9f5cb3b1c1ce2f3721896606b576.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://test_table.png"
dest_files=["res://.godot/imported/test_table.png-15007e285fb45460290ac1ad16f88048.ctex"]
source_file="res://operation/test_table.png"
dest_files=["res://.godot/imported/test_table.png-ed3e9f5cb3b1c1ce2f3721896606b576.ctex"]
[params]

View file

@ -11,9 +11,9 @@ config_version=5
[application]
config/name="necra-prototypes"
run/main_scene="res://prototype_dark_cut.tscn"
run/main_scene="res://operation/prototype_dark_cut.tscn"
config/features=PackedStringArray("4.3", "GL Compatibility")
config/icon="res://icon.svg"
config/icon="res://operation/icon.svg"
[display]