Added bg_sound manager and according ESC command.

Started transitions scene.
This commit is contained in:
Julian Murgia
2021-03-24 14:12:40 +01:00
parent 4acb971d54
commit 40dd4a6718
79 changed files with 1240 additions and 456 deletions

View File

@@ -8,3 +8,5 @@
teleport player player_start
stop
:ready
set_sound_state bg_music res://game/sfx/contemplation.ogg true

View File

@@ -15,11 +15,12 @@ __meta__ = {
global_id = "room1"
esc_script = "res://game/rooms/room1/esc/room1.esc"
player_scene = ExtResource( 4 )
camera_limits = [ Rect2( 0, 0, 1289, 555 ) ]
camera_limits = [ Rect2( 0, 0, 1285, 550 ) ]
editor_debug_mode = 1
[node name="background" parent="." instance=ExtResource( 2 )]
[node name="Advice" type="Label" parent="background"]
[node name="advice" type="Label" parent="background"]
margin_left = 90.2752
margin_top = 120.824
margin_right = 270.275
@@ -41,6 +42,7 @@ __meta__ = {
}
[node name="walkable_area" parent="." instance=ExtResource( 1 )]
position = Vector2( 3.5636, 0 )
[node name="Hotspots" type="Node2D" parent="."]
@@ -55,9 +57,6 @@ is_exit = true
tooltip_name = "Exit"
default_action = "walk"
dialog_color = Color( 1, 1, 1, 1 )
interact_positions = {
"default": Vector2( 1225.47, 353.99 )
}
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Hotspots/r_door"]
polygon = PoolVector2Array( 1177.94, 348.61, 1175.95, 45.3759, 1276.06, 92.0953, 1277.95, 399.407 )
@@ -73,9 +72,6 @@ esc_script = "res://game/rooms/room1/esc/wall_item.esc"
tooltip_name = "Item on the wall"
default_action = "look"
dialog_color = Color( 1, 1, 1, 1 )
interact_positions = {
"default": Vector2( 454.608, 373.035 )
}
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Hotspots/item"]
polygon = PoolVector2Array( 635.586, 253.345, 568.928, 60.1716, 709.047, 120.028, 699.524, 247.903 )
@@ -109,9 +105,6 @@ esc_script = "res://game/rooms/room1/esc/wall_item_popupdialog.esc"
tooltip_name = "Item on the wall"
default_action = "look"
dialog_color = Color( 1, 1, 1, 1 )
interact_positions = {
"default": Vector2( 861.442, 373.035 )
}
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Hotspots/item2"]
polygon = PoolVector2Array( 635.586, 253.345, 568.928, 60.1716, 709.047, 120.028, 699.524, 247.903 )

View File

@@ -0,0 +1,23 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://addons/escoria-core/game/core-scripts/escbackground.gd" type="Script" id=1]
[node name="background" type="TextureRect"]
margin_right = 1289.0
margin_bottom = 555.0
mouse_filter = 2
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="l_platform" type="Line2D" parent="."]
position = Vector2( 2, -266 )
points = PoolVector2Array( -2.96298, 712.01, 129.973, 614.429, 1167.5, 612.894, 1274.59, 669.705, 1273.25, 812.694, 2.36697, 811.043, 2.36697, 713.389 )
[node name="l_door" type="Line2D" parent="."]
position = Vector2( 0, -266 )
points = PoolVector2Array( 6.61201, 704.409, 6.61203, 389.558, 87.755, 339.775, 87.5463, 649.784 )
__meta__ = {
"_editor_description_": ""
}

View File

@@ -0,0 +1,2 @@
:use
set_sound_state bg_music res://game/sfx/contemplation.ogg true

View File

@@ -0,0 +1,3 @@
:use
set_sound_state bg_sound res://game/sfx/sounds/laser1.ogg false

View File

@@ -0,0 +1,2 @@
:use
set_sound_state bg_music off true

View File

@@ -0,0 +1,5 @@
:exit_scene
set_sound_state bg_sound res://game/sfx/sounds/doorOpen_2.ogg false
change_scene "res://game/rooms/room9/room9.tscn"

View File

@@ -0,0 +1,2 @@
:exit_scene

View File

@@ -0,0 +1,25 @@
# :SETUP is called EVERY TIME the room is loaded
# :READY is called only the FIRST TIME the room is loaded
:setup
> [eq ESC_LAST_SCENE room8]
teleport player r9_l_exit
# Set player look right
set_angle player 180
stop
> [eq ESC_LAST_SCENE room10]
teleport player r9_r_exit
# Set player look left
set_angle player 270
stop
> [!last_scene]
teleport player player_start
stop
:ready
set_global open_closets 0
#set_state r9_closet_left closed
#set_state r9_closet_middle closed
#set_state r9_closet_right closed

View File

@@ -0,0 +1,130 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://addons/escoria-core/game/core-scripts/escitem.gd" type="Script" id=1]
[sub_resource type="Animation" id=1]
resource_name = "r_door_close"
tracks/0/type = "value"
tracks/0/path = NodePath("r_door_closed:visible")
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": [ true ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("r_door_opened:visible")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ false ]
}
tracks/2/type = "value"
tracks/2/path = NodePath(".:is_exit")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ false ]
}
tracks/3/type = "value"
tracks/3/path = NodePath(".:default_action")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ "look" ]
}
[sub_resource type="Animation" id=2]
resource_name = "r_door_open"
length = 0.3
tracks/0/type = "value"
tracks/0/path = NodePath("r_door_closed:visible")
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": [ false ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("r_door_opened:visible")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ true ]
}
tracks/2/type = "value"
tracks/2/path = NodePath(".:is_exit")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ true ]
}
tracks/3/type = "value"
tracks/3/path = NodePath(".:default_action")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ "walk" ]
}
[node name="r_door" type="Area2D"]
script = ExtResource( 1 )
global_id = "r9_door"
esc_script = "res://game/rooms/room9/esc/r9_door.esc"
tooltip_name = "Door"
default_action = "look"
dialog_color = Color( 1, 1, 1, 1 )
[node name="r_door_closed" type="Polygon2D" parent="."]
color = Color( 0.482353, 0.568627, 1, 1 )
polygon = PoolVector2Array( 1172.3, 44.8186, 1172.3, 348.012, 1273.9, 401.983, 1277.07, 89.2657 )
[node name="r_door_opened" type="Polygon2D" parent="."]
visible = false
color = Color( 0.482353, 0.568627, 1, 1 )
polygon = PoolVector2Array( 1172.3, 44.8186, 1172.3, 348.012, 1029.82, 349.887, 1025.19, 42.1269 )
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
anims/r_door_close = SubResource( 1 )
anims/r_door_open = SubResource( 2 )
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."]
polygon = PoolVector2Array( 1169.35, 41.7644, 1168.09, 347.925, 1275.18, 407.141, 1278.96, 88.3814 )

View File

@@ -0,0 +1,129 @@
[gd_scene load_steps=10 format=2]
[ext_resource path="res://addons/escoria-core/game/core-scripts/escterrain.gd" type="Script" id=1]
[ext_resource path="res://game/rooms/room10/background.tscn" type="PackedScene" id=2]
[ext_resource path="res://game/ui/commons/fonts/caslonantique.tres" type="DynamicFont" id=3]
[ext_resource path="res://game/characters/mark/mark.tscn" type="PackedScene" id=4]
[ext_resource path="res://addons/escoria-core/game/core-scripts/escroom.gd" type="Script" id=6]
[ext_resource path="res://addons/escoria-core/game/core-scripts/escitem.gd" type="Script" id=7]
[ext_resource path="res://game/rooms/room2/button/button.tscn" type="PackedScene" id=8]
[ext_resource path="res://game/rooms/room10/r_door.tscn" type="PackedScene" id=9]
[sub_resource type="NavigationPolygon" id=1]
vertices = PoolVector2Array( 1168.92, 640.557, 1182.53, 588.863, 1269.59, 622.872, 1275.03, 799.721, 864.626, 613.518, 1143.08, 613.35, -9.16094, 803.802, 386.666, 618.012, 129.634, 615.792, 84.5821, 654.06, -6.44019, 711.297, 3.15687, 646.051, 59.2201, 628.698 )
polygons = [ PoolIntArray( 0, 1, 2, 3 ), PoolIntArray( 4, 5, 0, 3, 6, 7 ), PoolIntArray( 8, 7, 6, 9 ), PoolIntArray( 9, 6, 10, 11, 12 ) ]
outlines = [ PoolVector2Array( -6.44019, 711.297, 3.15687, 646.051, 59.2201, 628.698, 84.5821, 654.06, 129.634, 615.792, 386.666, 618.012, 864.626, 613.518, 1143.08, 613.35, 1168.92, 640.557, 1182.53, 588.863, 1269.59, 622.872, 1275.03, 799.721, -9.16094, 803.802 ) ]
[node name="room10" type="Node2D"]
script = ExtResource( 6 )
__meta__ = {
"_edit_vertical_guides_": [ ]
}
global_id = "room10"
esc_script = "res://game/rooms/room10/esc/room10.esc"
player_scene = ExtResource( 4 )
camera_limits = [ Rect2( 0, 0, 1289, 555 ) ]
[node name="background" parent="." instance=ExtResource( 2 )]
[node name="room_label" type="Label" parent="background"]
margin_right = 70.0
margin_bottom = 16.0
custom_fonts/font = ExtResource( 3 )
text = "ROOM 10"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="walkable_area" type="Navigation2D" parent="."]
script = ExtResource( 1 )
[node name="platform" type="NavigationPolygonInstance" parent="walkable_area"]
position = Vector2( 6.73163, -264.779 )
navpoly = SubResource( 1 )
__meta__ = {
"_editor_description_": ""
}
[node name="Hotspots" type="Node2D" parent="."]
[node name="l_door" type="Area2D" parent="Hotspots"]
script = ExtResource( 7 )
global_id = "r10_l_exit"
esc_script = "res://game/rooms/room10/esc/left_exit.esc"
is_exit = true
tooltip_name = "Left exit"
default_action = "walk"
dialog_color = Color( 1, 1, 1, 1 )
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Hotspots/l_door"]
polygon = PoolVector2Array( 0.328762, 440.897, 1.85199, 119.926, 85.9517, 74.6212, 87.1409, 377.869 )
[node name="Position2D" type="Position2D" parent="Hotspots/l_door"]
position = Vector2( 37.4521, 392.045 )
[node name="r_door" parent="Hotspots" instance=ExtResource( 9 )]
esc_script = "res://game/rooms/room10/esc/right_exit.esc"
[node name="Position2D" type="Position2D" parent="Hotspots/r_door"]
position = Vector2( 1198.65, 391.058 )
[node name="button_stop_bg_music" parent="Hotspots" instance=ExtResource( 8 )]
position = Vector2( 243.165, 154.97 )
global_id = "r10_btn_stop_bg_music"
esc_script = "res://game/rooms/room10/esc/button_stop_bg_music.esc"
[node name="Position2D" type="Position2D" parent="Hotspots/button_stop_bg_music"]
position = Vector2( 22.6786, 212.927 )
[node name="Label" type="Label" parent="Hotspots/button_stop_bg_music"]
margin_left = -8.81946
margin_top = -30.2381
margin_right = 61.1805
margin_bottom = -14.2381
custom_fonts/font = ExtResource( 3 )
text = "Stop bg music"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="button_play_bg_music" parent="Hotspots" instance=ExtResource( 8 )]
position = Vector2( 377.976, 154.97 )
global_id = "r10_btn_play_bg_music"
esc_script = "res://game/rooms/room10/esc/button_play_bg_music.esc"
[node name="Position2D" type="Position2D" parent="Hotspots/button_play_bg_music"]
position = Vector2( 22.6786, 212.927 )
[node name="Label" type="Label" parent="Hotspots/button_play_bg_music"]
margin_left = -8.81946
margin_top = -30.2381
margin_right = 61.1805
margin_bottom = -14.2381
custom_fonts/font = ExtResource( 3 )
text = "Play bg music"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="button_play_sound" parent="Hotspots" instance=ExtResource( 8 )]
position = Vector2( 646.339, 154.97 )
global_id = "r10_btn_play_snd"
esc_script = "res://game/rooms/room10/esc/button_play_snd.esc"
[node name="Position2D" type="Position2D" parent="Hotspots/button_play_sound"]
position = Vector2( 22.6786, 212.927 )
[node name="Label" type="Label" parent="Hotspots/button_play_sound"]
margin_left = -8.81946
margin_top = -30.2381
margin_right = 61.1805
margin_bottom = -14.2381
custom_fonts/font = ExtResource( 3 )
text = "Play sound"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="player_start" type="Position2D" parent="."]
position = Vector2( 76.7617, 437.649 )

View File

@@ -0,0 +1,18 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://addons/escoria-core/game/core-scripts/escterrain.gd" type="Script" id=1]
[sub_resource type="NavigationPolygon" id=1]
vertices = PoolVector2Array( 1168.92, 640.557, 1182.53, 588.863, 1269.59, 622.872, 1275.03, 799.721, 129.634, 615.792, 1143.08, 613.35, -9.16094, 803.802, 84.5821, 654.06, -6.44019, 711.297, 3.15687, 646.051, 59.2201, 628.698 )
polygons = [ PoolIntArray( 0, 1, 2, 3 ), PoolIntArray( 4, 5, 0, 3, 6, 7 ), PoolIntArray( 7, 6, 8, 9, 10 ) ]
outlines = [ PoolVector2Array( -6.44019, 711.297, 3.15687, 646.051, 59.2201, 628.698, 84.5821, 654.06, 129.634, 615.792, 1143.08, 613.35, 1168.92, 640.557, 1182.53, 588.863, 1269.59, 622.872, 1275.03, 799.721, -9.16094, 803.802 ) ]
[node name="walkable_area" type="Navigation2D"]
script = ExtResource( 1 )
[node name="platform" type="NavigationPolygonInstance" parent="."]
position = Vector2( 6.73163, -264.779 )
navpoly = SubResource( 1 )
__meta__ = {
"_editor_description_": ""
}

View File

@@ -38,9 +38,6 @@ __meta__ = {
global_id = "r3_right_platform"
esc_script = "res://game/rooms/room3/esc/right_platform.esc"
dialog_color = Color( 1, 1, 1, 1 )
interact_positions = {
"default": Vector2( 430.893, 451.052 )
}
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Hotspots/r_platform"]
polygon = PoolVector2Array( 870.974, 538.342, 827.536, 353.995, 1181.4, 357.174, 1287.34, 413.325, 1289.46, 545.758 )
@@ -64,9 +61,6 @@ esc_script = "res://game/rooms/room3/esc/right_exit.esc"
is_exit = true
tooltip_name = "Exit"
dialog_color = Color( 1, 1, 1, 1 )
interact_positions = {
"default": Vector2( 1225.47, 353.99 )
}
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Hotspots/r_door"]
polygon = PoolVector2Array( 1177.94, 348.61, 1175.95, 45.3759, 1276.06, 92.0953, 1277.95, 399.407 )
@@ -84,9 +78,6 @@ esc_script = "res://game/rooms/room3/esc/left_exit.esc"
is_exit = true
tooltip_name = "Exit"
dialog_color = Color( 1, 1, 1, 1 )
interact_positions = {
"default": Vector2( 44.1375, 384.691 )
}
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Hotspots/l_door"]
polygon = PoolVector2Array( -2.71457, 437.818, 6.6293, 121.462, 89.3893, 74.7422, 88.0545, 376.416 )
@@ -97,9 +88,6 @@ position = Vector2( 44.1375, 384.691 )
[node name="button" parent="Hotspots" instance=ExtResource( 7 )]
global_id = "r3_button"
esc_script = "res://game/rooms/room3/esc/button.esc"
interact_positions = {
"default": Vector2( 347.767, 378.011 )
}
[node name="Position2D" type="Position2D" parent="Hotspots/button"]
position = Vector2( 347.767, 378.011 )

View File

@@ -20,6 +20,7 @@ global_id = "room4"
esc_script = "res://game/rooms/room4/esc/room4.esc"
player_scene = ExtResource( 4 )
camera_limits = [ Rect2( 0, 0, 1666, 574 ) ]
editor_debug_mode = 1
[node name="background" type="TextureRect" parent="."]
margin_right = 1666.0
@@ -35,20 +36,6 @@ scale = Vector2( 0.692794, 0.692794 )
texture = ExtResource( 7 )
centered = false
[node name="l_platform" type="Line2D" parent="background"]
visible = false
position = Vector2( 2, -266 )
points = PoolVector2Array( 80.1882, 575.221, 161.613, 664.655, 472.392, 662.45, 685.125, 526.838, 860.996, 526.838, 1114.43, 647.617, 2242.97, 610.492, 2385.84, 672.401, 2389.93, 804.937, 1000, 795.942, 805.904, 564.979, 733.86, 562.86, 580.457, 806.537, -4.3772, 811.004, 4.10239, 576.556, 78.8534, 576.556 )
[node name="r_door" type="Line2D" parent="background"]
visible = false
position = Vector2( 0, -267.828 )
points = PoolVector2Array( 2252.91, 610.733, 2251.32, 332.938, 2384.66, 386.909, 2386.25, 674.229, 2254.5, 615.495 )
[node name="l_door" type="Line2D" parent="background"]
visible = false
points = PoolVector2Array( 6.10242, 307.886, 2.0979, 129.017, 84.858, 129.017, 84.858, 311.89, 4.76758, 307.886 )
[node name="room_label" type="Label" parent="background"]
margin_right = 40.0
margin_bottom = 14.0
@@ -88,9 +75,6 @@ global_id = "l_exit"
esc_script = "res://game/rooms/room4/esc/left_exit.esc"
is_exit = true
dialog_color = Color( 1, 1, 1, 1 )
interact_positions = {
"default": Vector2( 83.6298, 279.703 )
}
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Hotspots/l_door"]
polygon = PoolVector2Array( 29.1046, 292.156, 31.0151, 76.8949, 147.177, 74.4792, 151.415, 293.788 )
@@ -104,9 +88,6 @@ global_id = "r_exit"
esc_script = "res://game/rooms/room4/esc/right_exit.esc"
is_exit = true
dialog_color = Color( 1, 1, 1, 1 )
interact_positions = {
"default": Vector2( 1611.46, 301.017 )
}
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Hotspots/r_door"]
polygon = PoolVector2Array( 1567.92, 294.848, 1573.21, 92.4902, 1657.34, 129.485, 1654.79, 343.583 )

View File

@@ -1,9 +1,11 @@
:look
say player "He's looking a bit odd."
####################################################################################################
:pickup
say player "I don't think he'd like that."
####################################################################################################
:talk
> [!talked_once]
say player "Uhm..."
@@ -31,16 +33,17 @@ say player "I don't think he'd like that."
say worker "Go away, kid."
stop
####################################################################################################
:use r5_filled_sheet
jump give r5_filled_sheet
####################################################################################################
:give r5_filled_sheet
inventory_remove r5_filled_sheet
say worker "Hey! That's perfect!"
say worker "I can finally get away from here!"
walk_to_pos worker 1200 400
walk_to_pos_block worker 1200 400
#set_angle worker 45
# Open the door

View File

@@ -46,15 +46,6 @@ width = 4.0
[node name="walkable_area" type="Navigation2D" parent="."]
script = ExtResource( 1 )
scales = null
bitmaps_scale = Vector2( 1, 1 )
lightmap = null
player_speed_multiplier = 1.0
player_doubleclick_speed_multiplier = 1.5
lightmap_modulate = Color( 1, 1, 1, 1 )
debug_mode = 1
scale_min = 0.3
scale_max = 1.0
[node name="platform" type="NavigationPolygonInstance" parent="walkable_area"]
position = Vector2( 6.73163, -264.779 )

View File

@@ -1,2 +1,2 @@
:exit_scene
change_scene "res://game/rooms/room10/room10.tscn"

View File

@@ -1,4 +1,4 @@
:use r9_bottle
set_state r9_stand set_bottle
set_state r9_door r_door_open
set_state r9_r_exit r_door_open

View File

@@ -81,6 +81,7 @@ polygon = PoolVector2Array( 0.328762, 440.897, 1.85199, 119.926, 85.9517, 74.621
position = Vector2( 37.4521, 392.045 )
[node name="r_door" parent="Hotspots" instance=ExtResource( 9 )]
global_id = "r9_r_exit"
esc_script = "res://game/rooms/room9/esc/right_exit.esc"
[node name="Position2D" type="Position2D" parent="Hotspots/r_door"]