haha
This commit is contained in:
6
Levels/Collectible.gd
Normal file
6
Levels/Collectible.gd
Normal file
@@ -0,0 +1,6 @@
|
||||
extends Node2D
|
||||
|
||||
var dialog = get_parent().get_node('HUD/Control')
|
||||
|
||||
func _on_Area2D_body_entered(body):
|
||||
dialog.visible = true
|
15
Levels/JournalScrap.tscn
Normal file
15
Levels/JournalScrap.tscn
Normal file
@@ -0,0 +1,15 @@
|
||||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://Sprites/Assets/JournalScrap.png" type="Texture" id=1]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
|
||||
[node name="Node2D" type="Node2D"]
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="."]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
||||
shape = SubResource( 1 )
|
@@ -4,4 +4,10 @@ func _ready() -> void:
|
||||
#$YSort/Player.position = get_viewport_rect().size / 2
|
||||
$YSort/Player.position = Vector2(0,0)
|
||||
$YSort/Player.load_hud($HUD)
|
||||
$HUD/Control.visible = false
|
||||
return
|
||||
|
||||
|
||||
func _on_Area2D_body_entered(body):
|
||||
$HUD/Control.visible = true
|
||||
print("j")
|
||||
|
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=85 format=2]
|
||||
[gd_scene load_steps=88 format=2]
|
||||
|
||||
[ext_resource path="res://Player/Player.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://Levels/Level 2.gd" type="Script" id=2]
|
||||
@@ -17,6 +17,8 @@
|
||||
[ext_resource path="res://Levels/Traps/Spawn Trap.tscn" type="PackedScene" id=15]
|
||||
[ext_resource path="res://Sprites/Assets/Skull.png" type="Texture" id=16]
|
||||
[ext_resource path="res://Sprites/Assets/grassPatch.png" type="Texture" id=17]
|
||||
[ext_resource path="res://Sprites/Assets/JournalScrap.png" type="Texture" id=18]
|
||||
[ext_resource path="res://Levels/Objects/Dialogue.tscn" type="PackedScene" id=19]
|
||||
|
||||
[sub_resource type="TileSet" id=1]
|
||||
0/name = "darkForestTileset.png 0"
|
||||
@@ -767,6 +769,8 @@ points = PoolVector2Array( 34.2487, 55.6436, 7.92332, 55.4821, 14.222, 39.5738,
|
||||
8/shapes = [ ]
|
||||
8/z_index = 0
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=68]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=65]
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id=66]
|
||||
@@ -791,6 +795,11 @@ radius = 22.8792
|
||||
[node name="World" type="Node2D"]
|
||||
script = ExtResource( 2 )
|
||||
|
||||
[node name="HUD" parent="." instance=ExtResource( 8 )]
|
||||
|
||||
[node name="Control" parent="HUD" instance=ExtResource( 19 )]
|
||||
visible = false
|
||||
|
||||
[node name="YSort" type="YSort" parent="."]
|
||||
|
||||
[node name="Player" parent="YSort" instance=ExtResource( 1 )]
|
||||
@@ -882,10 +891,19 @@ format = 1
|
||||
tile_data = PoolIntArray( -2883568, 6, 0, -2818047, 6, 0, -2818023, 6, 0, -2752509, 6, 0, -2752505, 6, 0, -2752501, 6, 0, -2686971, 6, 0, -2686967, 6, 0, -2686953, 6, 0, -2686952, 6, 0, -2621440, 6, 0, -2555884, 6, 0, -2490345, 6, 0, -2359285, 3, 2, -2359274, 3, 2, -2293753, 3, 1, -2293745, 6, 0, -2293741, 6, 0, -2162686, 6, 0, -1966061, 6, 0, -1966055, 6, 0, -1900544, 3, 2, -1900518, 3, 2, -1834988, 6, 0, -1834986, 6, 0, -1769466, 6, 0, -1769453, 6, 0, -1769450, 6, 0, -1703932, 6, 0, -1703930, 6, 0, -1703915, 6, 0, -1638400, 6, 0, -1572858, 6, 0, -1572838, 3, 2, -1507308, 6, 0, -1441790, 6, 0, -1441788, 6, 0, -1441782, 3, 1, -1441771, 6, 0, -1376253, 6, 0, -1376233, 6, 0, -1245184, 3, 2, -1245182, 6, 0, -1245177, 6, 0, -1179630, 6, 0, -1114090, 3, 2, -851962, 3, 2, -851959, 3, 131072, -786431, 3, 0, -786420, 3, 65537, -720877, 1, 0, -655358, 1, 0, -655356, 1, 0, -655354, 1, 0, -655352, 1, 0, -524290, 1, 0, -589821, 1, 0, -589818, 1, 0, -589802, 3, 65537, -524287, 3, 131072, -393217, 1, 0, -458751, 1, 0, -458730, 3, 1, -327684, 3, 2, -393216, 1, 0, -393211, 1, 0, -393199, 1, 0, -393195, 3, 65538, -262146, 3, 65537, -327677, 1, 0, -327665, 1, 0, -196611, 3, 65538, -262144, 1, 0, -262142, 1, 0, -262139, 1, 0, -262127, 1, 0, -262125, 1, 0, -196593, 3, 131072, -131057, 1, 0, -131054, 1, 0, -65527, 3, 0, -65523, 3, 65537, -65514, 3, 0, 2, 1, 0, 11, 3, 65536, 17, 1, 0, 65536, 1, 0, 65537, 3, 1, 65540, 1, 0, 65551, 1, 0, 65552, 3, 65538, 65555, 1, 0, 131074, 1, 0, 131082, 1, 0, 131089, 1, 0, 196608, 1, 0, 196614, 3, 65536, 196616, 1, 0, 196630, 3, 131072, 262147, 3, 0, 262153, 0, 4, 393214, 3, 65536, 327682, 0, 3, 327687, 0, 3, 327688, 0, 131074, 327689, 0, 65536, 327692, 3, 131073, 458751, 3, 2, 393217, 0, 3, 393218, 0, 131074, 393222, 0, 131073, 393223, 0, 131074, 393224, 0, 0, 393225, 0, 65540, 393233, 3, 131074, 393238, 3, 1, 458753, 1, 0, 458754, 0, 1, 458755, 1, 0, 458757, 1, 0, 458758, 0, 1, 458759, 0, 1, 458760, 0, 65540, 458761, 3, 2, 458773, 3, 65537, 524288, 1, 0, 524291, 0, 65539, 524292, 0, 65540, 524295, 3, 131072, 524303, 3, 2, 524305, 1, 0, 524308, 3, 2, 589828, 1, 0, 589830, 1, 0, 720894, 3, 131074, 655360, 1, 0, 655361, 3, 65536, 655368, 3, 65537, 655382, 3, 1, 786434, 3, 1, 786438, 3, 0, 786440, 3, 65536, 786443, 3, 0, 786445, 3, 65537, 786453, 3, 65538, 851974, 3, 2 )
|
||||
|
||||
[node name="Collectible" type="Node2D" parent="."]
|
||||
position = Vector2( 350, 0 )
|
||||
scale = Vector2( 0.5, 0.5 )
|
||||
z_index = 4
|
||||
|
||||
[node name="Journal Scrap" type="Sprite" parent="Collectible"]
|
||||
[node name="Area2D" type="Area2D" parent="Collectible"]
|
||||
collision_layer = 3
|
||||
collision_mask = 3
|
||||
|
||||
[node name="HUD" parent="." instance=ExtResource( 8 )]
|
||||
[node name="Sprite2" type="Sprite" parent="Collectible/Area2D"]
|
||||
texture = ExtResource( 18 )
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Collectible/Area2D"]
|
||||
shape = SubResource( 68 )
|
||||
|
||||
[node name="Pause Screen" parent="." instance=ExtResource( 5 )]
|
||||
|
||||
@@ -922,5 +940,6 @@ tile_set = SubResource( 67 )
|
||||
format = 1
|
||||
tile_data = PoolIntArray( -589828, 0, 0, -458754, 0, 0, -393220, 0, 0 )
|
||||
|
||||
[connection signal="body_entered" from="Collectible/Area2D" to="." method="_on_Area2D_body_entered"]
|
||||
[connection signal="body_entered" from="TreasureChest/ChestDetection" to="TreasureChest/ChestDetection" method="_on_ChestDetection_body_entered"]
|
||||
[connection signal="body_entered" from="TreasureChest/PortalDarkForest" to="YSort/Player/Camera2D" method="_on_PortalDarkForest_body_entered"]
|
||||
|
63
Levels/Objects/DialogBox.gd
Normal file
63
Levels/Objects/DialogBox.gd
Normal file
@@ -0,0 +1,63 @@
|
||||
extends ColorRect
|
||||
|
||||
export var dialogPath = ""
|
||||
export(float) var textSpeed = 0.05
|
||||
|
||||
var dialog
|
||||
var phraseNum = 0
|
||||
var finished = false
|
||||
|
||||
func _ready():
|
||||
# self.visible = false
|
||||
$Timer.wait_time = textSpeed
|
||||
dialog = getDialog()
|
||||
assert(dialog, "Dialong not found")
|
||||
nextPhrase()
|
||||
|
||||
|
||||
func _process(delta):
|
||||
$Indicator.visible = finished
|
||||
if Input.is_action_just_pressed("ui_accept"):
|
||||
if finished:
|
||||
nextPhrase()
|
||||
else:
|
||||
$Text.visible_characters = len($Text.text)
|
||||
func getDialog() -> Array:
|
||||
var f = File.new()
|
||||
assert(f.file_exists(dialogPath), "File path does not exist")
|
||||
|
||||
f.open(dialogPath, File.READ)
|
||||
var json = f.get_as_text()
|
||||
|
||||
var output = parse_json(json)
|
||||
|
||||
if typeof(output) == TYPE_ARRAY:
|
||||
return output
|
||||
else:
|
||||
return []
|
||||
|
||||
func nextPhrase() -> void:
|
||||
if phraseNum >= len(dialog):
|
||||
queue_free()
|
||||
return
|
||||
|
||||
finished = false
|
||||
|
||||
$Name.bbcode_text = dialog[phraseNum]["Name"]
|
||||
$Text.bbcode_text = dialog[phraseNum]["Text"]
|
||||
|
||||
$Text.visible_characters = 0
|
||||
|
||||
while $Text.visible_characters < len($Text.text):
|
||||
$Text.visible_characters += 1
|
||||
|
||||
$Timer.start()
|
||||
yield($Timer, "timeout")
|
||||
|
||||
finished = true
|
||||
phraseNum += 1
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
84
Levels/Objects/Dialogue.tscn
Normal file
84
Levels/Objects/Dialogue.tscn
Normal file
@@ -0,0 +1,84 @@
|
||||
[gd_scene load_steps=6 format=2]
|
||||
|
||||
[ext_resource path="res://Levels/Objects/DialogBox.gd" type="Script" id=1]
|
||||
[ext_resource path="res://Fonts/AtariClassicSmooth.ttf" type="DynamicFontData" id=2]
|
||||
|
||||
[sub_resource type="DynamicFont" id=2]
|
||||
size = 20
|
||||
extra_spacing_top = -1
|
||||
extra_spacing_bottom = -1
|
||||
extra_spacing_char = -1
|
||||
font_data = ExtResource( 2 )
|
||||
|
||||
[sub_resource type="Theme" id=3]
|
||||
default_font = SubResource( 2 )
|
||||
|
||||
[sub_resource type="Animation" id=1]
|
||||
resource_name = "bounce"
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("AnimationPlayer:root_node")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
"update": 1,
|
||||
"values": [ NodePath("..") ]
|
||||
}
|
||||
|
||||
[node name="Control" type="Control"]
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="DialogBox" type="ColorRect" parent="."]
|
||||
margin_left = 60.0
|
||||
margin_top = 145.0
|
||||
margin_right = 335.0
|
||||
margin_bottom = 185.0
|
||||
rect_min_size = Vector2( 275, 40 )
|
||||
rect_scale = Vector2( 0.7, 0.730801 )
|
||||
theme = SubResource( 3 )
|
||||
color = Color( 0.776471, 0.752941, 0.647059, 1 )
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
dialogPath = "res://Levels/Objects/journalScrapDialog.json"
|
||||
|
||||
[node name="Name" type="RichTextLabel" parent="DialogBox"]
|
||||
anchor_bottom = 2.0
|
||||
margin_right = 500.0
|
||||
margin_bottom = -17.0
|
||||
rect_scale = Vector2( 0.4, 0.4 )
|
||||
custom_colors/default_color = Color( 0, 0, 0, 1 )
|
||||
text = "ddd"
|
||||
fit_content_height = true
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Text" type="RichTextLabel" parent="DialogBox"]
|
||||
margin_top = 9.0
|
||||
margin_right = 500.0
|
||||
margin_bottom = 70.0
|
||||
rect_scale = Vector2( 0.4, 0.4 )
|
||||
custom_colors/default_color = Color( 0, 0, 0, 1 )
|
||||
text = "dddd"
|
||||
scroll_active = false
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Indicator" type="Polygon2D" parent="DialogBox"]
|
||||
position = Vector2( -104, 104 )
|
||||
color = Color( 0, 0, 0, 1 )
|
||||
antialiased = true
|
||||
polygon = PoolVector2Array( 370.756, -68.0704, 376.296, -74.7627, 365.367, -74.6793 )
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="DialogBox/Indicator"]
|
||||
anims/bounce = SubResource( 1 )
|
||||
|
||||
[node name="Timer" type="Timer" parent="DialogBox"]
|
5
Levels/Objects/journalScrapDialog.json
Normal file
5
Levels/Objects/journalScrapDialog.json
Normal file
@@ -0,0 +1,5 @@
|
||||
[
|
||||
{"Name":"???", "Text":"Did they REALLY think they would be able to leave the ethereal plane?!"},
|
||||
{"Name":"???", "Text":"No one ever leaves the ethereal plane!"},
|
||||
{"Name":"???", "Text":"What a joke."}
|
||||
]
|
@@ -28,7 +28,6 @@ process/fix_alpha_border=false
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
process/normal_map_invert_y=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=false
|
||||
|
@@ -28,7 +28,6 @@ process/fix_alpha_border=false
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
process/normal_map_invert_y=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=false
|
||||
|
@@ -28,7 +28,6 @@ process/fix_alpha_border=false
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
process/normal_map_invert_y=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=false
|
||||
|
@@ -12,11 +12,11 @@ config_version=4
|
||||
|
||||
config/name="Embodiment"
|
||||
run/main_scene="res://Main.tscn"
|
||||
run/delta_sync_after_draw=true
|
||||
boot_splash/image="res://Sprites/Assets/Black_Background.png"
|
||||
boot_splash/use_filter=false
|
||||
boot_splash/bg_color=Color( 0, 0, 0, 1 )
|
||||
config/icon="res://Sprites/Assets/icon.png"
|
||||
run/delta_sync_after_draw=true
|
||||
|
||||
[display]
|
||||
|
||||
@@ -31,33 +31,33 @@ window/stretch/aspect="keep"
|
||||
|
||||
player_right={
|
||||
"deadzone": 0.5,
|
||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
|
||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
player_left={
|
||||
"deadzone": 0.5,
|
||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":65,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
|
||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":65,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
player_up={
|
||||
"deadzone": 0.5,
|
||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":87,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
|
||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":87,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
player_down={
|
||||
"deadzone": 0.5,
|
||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":83,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
|
||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":83,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
screenshot={
|
||||
"deadzone": 0.5,
|
||||
"events": [ Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":1,"pressed":false,"doubleclick":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
player_attack={
|
||||
"deadzone": 0.5,
|
||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
|
||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":1,"pressed":false,"doubleclick":false,"script":null)
|
||||
]
|
||||
}
|
||||
|
Reference in New Issue
Block a user