Added check on "arrived" event in Movable so that the right context continues, not others.

To continue: move walk_* variables in ESCPlayer into Movable makes camera go wrong.
This commit is contained in:
Julian Murgia
2021-01-27 17:02:13 +01:00
parent 41e289cce9
commit 183439337a
12 changed files with 120 additions and 58 deletions

View File

@@ -4,12 +4,10 @@
[ext_resource path="res://game/rooms/room2/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://game/rooms/room2/button/button.tscn" type="PackedScene" id=5]
[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]
[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 28.6442, 23.5021 )
[node name="room2" type="Node2D"]
script = ExtResource( 6 )
global_id = "room2"
@@ -82,47 +80,33 @@ polygon = PoolVector2Array( -1.37926, 443.158, 7.96461, 122.796, 84.0504, 77.411
[node name="Position2D" type="Position2D" parent="Hotspots/l_door"]
position = Vector2( 52.1462, 384.691 )
[node name="button_left" type="Area2D" parent="Hotspots"]
script = ExtResource( 7 )
global_id = "r2_button"
esc_script = "res://game/rooms/room2/esc/button.esc"
tooltip_name = "Button"
default_action = "use"
dialog_color = Color( 1, 1, 1, 1 )
interact_positions = {
"default": Vector2( 338.117, 370.025 )
}
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hotspots/button_left"]
position = Vector2( 346.507, 150.721 )
shape = SubResource( 1 )
[node name="action_pos" type="Position2D" parent="Hotspots/button_left"]
position = Vector2( 338.117, 370.025 )
[node name="dialog_position" type="Position2D" parent="Hotspots/button_left"]
position = Vector2( 333.879, 84.4147 )
[node name="button_right" type="Area2D" parent="Hotspots"]
script = ExtResource( 7 )
[node name="button_right" parent="Hotspots" instance=ExtResource( 5 )]
global_id = "r2_button_right"
esc_script = "res://game/rooms/room2/esc/button.esc"
tooltip_name = "Button"
default_action = "use"
dialog_color = Color( 1, 1, 1, 1 )
interact_positions = {
"default": Vector2( 962.822, 370.025 )
"default": Vector2( 971.212, 150.721 )
}
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hotspots/button_right"]
position = Vector2( 971.212, 150.721 )
shape = SubResource( 1 )
[node name="button_left" parent="Hotspots/button_right" instance=ExtResource( 5 )]
visible = false
position = Vector2( -625.523, 0 )
global_id = "r2_button"
esc_script = "res://game/rooms/room2/esc/button.esc"
interact_positions = {
"default": Vector2( 971.212, 150.721 )
}
[node name="action_pos" type="Position2D" parent="Hotspots/button_right"]
[node name="Position2D" type="Position2D" parent="Hotspots/button_right"]
position = Vector2( 962.822, 370.025 )
__meta__ = {
"_editor_description_": ""
}
[node name="dialog_position" type="Position2D" parent="Hotspots/button_right"]
position = Vector2( 958.584, 84.4147 )
[node name="Position2D2" type="Position2D" parent="Hotspots/button_right"]
position = Vector2( 337.299, 370.025 )
__meta__ = {
"_editor_description_": ""
}
[node name="player_start" type="Position2D" parent="."]
position = Vector2( 76.7617, 437.649 )

View File

@@ -22,6 +22,9 @@ margin_right = 40.0
margin_bottom = 14.0
custom_fonts/font = ExtResource( 3 )
text = "ROOM 3"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="walkable_area" parent="." instance=ExtResource( 1 )]
@@ -102,5 +105,17 @@ __meta__ = {
"_editor_description_": ""
}
[node name="button_label" type="Label" parent="Hotspots/button"]
margin_left = 398.135
margin_top = 132.292
margin_right = 642.135
margin_bottom = 167.292
custom_fonts/font = ExtResource( 3 )
text = "I know, this doesn't sound logical
but you should try talking with this button..."
__meta__ = {
"_edit_use_anchors_": false
}
[node name="player_start" type="Position2D" parent="."]
position = Vector2( 63.3074, 444.653 )

View File

@@ -55,6 +55,14 @@ margin_bottom = 14.0
custom_fonts/font = ExtResource( 3 )
text = "ROOM 4"
[node name="Label" type="Label" parent="background"]
margin_left = 214.299
margin_top = 93.6566
margin_right = 1008.3
margin_bottom = 109.657
custom_fonts/font = ExtResource( 3 )
text = "This room demonstrates how to use a background image AND using a large image width AND setting a depth map on the ESCTerrain node"
[node name="walkable_area" type="Navigation2D" parent="."]
script = ExtResource( 1 )
scales = ExtResource( 8 )

View File

@@ -129,7 +129,7 @@ esc_script = "res://game/rooms/room5/esc/wall_item.esc"
tooltip_name = "Item on the wall"
default_action = "look"
interact_positions = {
"default": Vector2( 657, 377 )
"default": Vector2( 622.513, 359.162 )
}
[node name="Position2D2" type="Position2D" parent="Hotspots/item_wall"]
@@ -150,12 +150,14 @@ position = Vector2( -77.4207, 0 )
[node name="pen" parent="Hotspots" instance=ExtResource( 10 )]
position = Vector2( 909.908, 443.451 )
dialog_color = Color( 1, 1, 1, 1 )
interact_positions = {
"default": Vector2( 909.908, 443.451 )
}
[node name="empty_sheet" parent="Hotspots" instance=ExtResource( 9 )]
position = Vector2( 1059.84, 440.932 )
dialog_color = Color( 1, 1, 1, 1 )
interact_positions = {
"default": Vector2( 1059.84, 440.932 )
}

View File

@@ -3,11 +3,20 @@
:setup
set_state r7_button_push button_repaired
set_state r7_button_shift button_repaired
set_state r7_button_follow button_repaired
set_state r7_button_zoom button_repaired
> [eq ESC_LAST_SCENE room6]
teleport player r7_l_exit
# Set player look right
set_angle player 180
stop
> [eq ESC_LAST_SCENE room8]
teleport player r7_r_exit
# Set player look left
set_angle player 270
stop
> [!last_scene]
teleport player player_start
stop

View File

@@ -281,7 +281,7 @@ __meta__ = {
[node name="button_camera_shift" parent="Hotspots" instance=ExtResource( 3 )]
position = Vector2( 9.393, 1464.03 )
global_id = "r7_button_push"
global_id = "r7_button_shift"
esc_script = "res://game/rooms/room7/esc/button_shift.esc"
interact_positions = {
"default": Vector2( 359.651, 1765.65 )

View File

@@ -12,7 +12,7 @@ vertices = PoolVector2Array( 1143.08, 613.35, 1267.68, 669.029, 1275.03, 799.721
polygons = [ PoolIntArray( 0, 1, 2, 3, 4, 5, 6 ), PoolIntArray( 7, 8, 9, 10 ), PoolIntArray( 4, 11, 12, 5 ), PoolIntArray( 5, 13, 14, 15 ), PoolIntArray( 7, 10, 6, 15 ), PoolIntArray( 6, 16, 0 ), PoolIntArray( 6, 5, 15 ) ]
outlines = [ PoolVector2Array( -6.44019, 711.297, 3.15687, 646.051, 59.2201, 628.698, 84.5821, 654.06, 129.634, 615.792, 530.631, 612.332, 550.79, 623.672, 581.028, 613.592, 583.548, 574.535, 707.02, 574.535, 714.58, 611.072, 742.298, 623.672, 783.875, 609.812, 1143.08, 613.35, 1267.68, 669.029, 1275.03, 799.721, -9.16094, 803.802 ) ]
[sub_resource type="Animation" id=3]
[sub_resource type="Animation" id=2]
resource_name = "door_close"
tracks/0/type = "value"
tracks/0/path = NodePath("door:polygon")
@@ -39,7 +39,7 @@ tracks/1/keys = {
"values": [ false ]
}
[sub_resource type="Animation" id=4]
[sub_resource type="Animation" id=3]
resource_name = "door_open"
tracks/0/type = "value"
tracks/0/path = NodePath("door:polygon")
@@ -66,7 +66,7 @@ tracks/1/keys = {
"values": [ false, true ]
}
[sub_resource type="RectangleShape2D" id=2]
[sub_resource type="RectangleShape2D" id=4]
extents = Vector2( 20.3273, 18.0047 )
[node name="room8" type="Node2D"]
@@ -155,7 +155,7 @@ esc_script = "res://game/rooms/room8/esc/middle_exit.esc"
tooltip_name = "Exit"
dialog_color = Color( 1, 1, 1, 1 )
interact_positions = {
"default": Vector2( 1225.47, 353.99 )
"default": Vector2( 653.466, 366.589 )
}
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Hotspots/m_door"]
@@ -169,8 +169,8 @@ color = Color( 0.4, 0.501961, 1, 1 )
polygon = PoolVector2Array( 557.104, 45.8, 743.623, 45.8, 746.798, 345.025, 557.898, 347.406 )
[node name="AnimationPlayer" type="AnimationPlayer" parent="Hotspots/m_door"]
anims/door_close = SubResource( 3 )
anims/door_open = SubResource( 4 )
anims/door_close = SubResource( 2 )
anims/door_open = SubResource( 3 )
[node name="r8_mini_puzzle_button" type="Area2D" parent="Hotspots"]
script = ExtResource( 5 )
@@ -180,7 +180,7 @@ tooltip_name = "Button"
default_action = "use"
dialog_color = Color( 1, 1, 1, 1 )
interact_positions = {
"default": null
"default": Vector2( 474.801, 369.29 )
}
[node name="button" type="Line2D" parent="Hotspots/r8_mini_puzzle_button"]
@@ -190,7 +190,7 @@ default_color = Color( 0.4, 0.501961, 1, 1 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hotspots/r8_mini_puzzle_button"]
position = Vector2( 474.343, 201.414 )
shape = SubResource( 2 )
shape = SubResource( 4 )
[node name="Position2D" type="Position2D" parent="Hotspots/r8_mini_puzzle_button"]
position = Vector2( 474.801, 369.29 )
@@ -215,7 +215,7 @@ tooltip_name = "Button"
default_action = "use"
dialog_color = Color( 1, 1, 1, 1 )
interact_positions = {
"default": Vector2( 474.801, 369.29 )
"default": Vector2( 335.616, 369.29 )
}
[node name="button" type="Line2D" parent="Hotspots/r8_reset_puzzle_button"]
@@ -225,7 +225,7 @@ default_color = Color( 0.4, 0.501961, 1, 1 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hotspots/r8_reset_puzzle_button"]
position = Vector2( 474.343, 201.414 )
shape = SubResource( 2 )
shape = SubResource( 4 )
[node name="Position2D" type="Position2D" parent="Hotspots/r8_reset_puzzle_button"]
position = Vector2( 474.801, 369.29 )

View File

@@ -20,7 +20,7 @@
# 7/ long room with camera shift to object 2 if look on object 1
# and stairs with camera shift too
#change_scene res://game/rooms/room7/room7.tscn
change_scene res://game/rooms/room7/room7.tscn
# 8/ puzzle in superposed scene
change_scene res://game/rooms/room8/room8.tscn
#change_scene res://game/rooms/room8/room8.tscn