Re-implemented turn_to command (#390)

* Re-implemented turn_to command

Fixes #385
Fixed a bug in esc_movable blocking player_orients_on_arrival for ESCLocation nodes

* docs: Automatic update of API docs

* Fixes

Co-authored-by: StraToN <StraToN@users.noreply.github.com>
This commit is contained in:
Julian Murgia
2021-09-09 22:57:03 +02:00
committed by GitHub
parent ad390a6f65
commit 0e6e8aa161
14 changed files with 148 additions and 102 deletions

View File

@@ -8,6 +8,7 @@
extents = Vector2( 28.3873, 74.7806 )
[node name="bottle" type="Area2D"]
pause_mode = 1
z_index = 1
script = ExtResource( 3 )
global_id = "r9_bottle"
@@ -19,6 +20,7 @@ combine_if_action_used_among = PoolStringArray( "use" )
use_from_inventory_only = true
inventory_item_scene_file = ExtResource( 2 )
dialog_color = Color( 1, 1, 1, 1 )
animations = null
[node name="sprite" type="Sprite" parent="."]
texture = ExtResource( 1 )

View File

@@ -17,10 +17,14 @@ set_sound_state _music res://game/sfx/contemplation.ogg true
set_global room1_visited true
set_global dialog_advance 0
set_global dialog_popup_advance 0
walk player r1_destination_point
walk_block player r1_destination_point
wait 2
walk player r1_destination_point2
walk_block player r1_destination_point2
wait 2
set_angle player 225 false
wait 2
walk_block player r1_destination_point3
wait 1
turn_to player r1_r_exit false

View File

@@ -0,0 +1,27 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_item.gd" type="Script" id=1]
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_location.gd" type="Script" id=2]
[node name="item" type="Area2D"]
pause_mode = 1
script = ExtResource( 1 )
tooltip_name = "Item on the wall"
default_action = "look"
dialog_color = Color( 1, 1, 1, 1 )
animations = null
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."]
position = Vector2( -652.737, -162.85 )
polygon = PoolVector2Array( 635.586, 253.345, 568.928, 60.1716, 709.047, 120.028, 699.524, 247.903 )
[node name="Line2D" type="Line2D" parent="."]
position = Vector2( -655.406, -430.678 )
points = PoolVector2Array( 634.097, 516.751, 578.861, 335.008, 701.805, 386.68, 696.459, 509.624, 634.097, 516.751 )
__meta__ = {
"_editor_description_": ""
}
[node name="ESCLocation" type="Position2D" parent="."]
position = Vector2( 0, 236.267 )
script = ExtResource( 2 )

View File

@@ -18,8 +18,9 @@ dialog_color = Color( 1, 1, 1, 1 )
animations = null
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."]
position = Vector2( -1229.68, -223.006 )
polygon = PoolVector2Array( 1177.94, 348.61, 1175.95, 45.3759, 1276.06, 92.0953, 1277.95, 399.407 )
[node name="Position2D" type="Position2D" parent="."]
position = Vector2( 1225.47, 353.99 )
position = Vector2( -0.432617, 124.685 )
script = ExtResource( 2 )

View File

@@ -4,10 +4,10 @@
[ext_resource path="res://game/rooms/room01/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/esc_item.gd" type="Script" id=5]
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_room.gd" type="Script" id=6]
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_location.gd" type="Script" id=7]
[ext_resource path="res://game/rooms/room01/r_door.tscn" type="PackedScene" id=8]
[ext_resource path="res://game/rooms/room01/item.tscn" type="PackedScene" id=9]
[node name="room1" type="Node2D"]
script = ExtResource( 6 )
@@ -49,99 +49,66 @@ position = Vector2( 3.5636, 0 )
[node name="Hotspots" type="Node2D" parent="."]
[node name="r_door" parent="Hotspots" instance=ExtResource( 8 )]
position = Vector2( 1225.9, 217.966 )
[node name="ESCLocation" type="Position2D" parent="Hotspots/r_door"]
position = Vector2( 1229.68, 355.298 )
position = Vector2( 1.35498, 136.453 )
script = ExtResource( 7 )
[node name="item" type="Area2D" parent="Hotspots"]
pause_mode = 1
position = Vector2( -217.19, 0 )
script = ExtResource( 5 )
[node name="item" parent="Hotspots" instance=ExtResource( 9 )]
position = Vector2( 480.542, 146.832 )
global_id = "r1_wall_item1"
esc_script = "res://game/rooms/room01/esc/wall_item.esc"
tooltip_name = "Item on the wall"
default_action = "look"
dialog_color = Color( 1, 1, 1, 1 )
animations = null
[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 )
[node name="Position2D" type="Position2D" parent="Hotspots/item"]
position = Vector2( 671.798, 373.035 )
script = ExtResource( 7 )
global_id = "r1_left_object_interaction"
[node name="Line2D" type="Line2D" parent="Hotspots/item"]
position = Vector2( 0, -267.828 )
points = PoolVector2Array( 634.097, 516.751, 578.861, 335.008, 701.805, 386.68, 696.459, 509.624, 634.097, 516.751 )
__meta__ = {
"_editor_description_": ""
}
[node name="Label" type="Label" parent="Hotspots/item"]
margin_left = 563.635
margin_top = 265.925
margin_right = 759.635
margin_bottom = 279.925
margin_left = -105.12
margin_top = 121.762
margin_right = 122.88
margin_bottom = 142.762
custom_fonts/font = ExtResource( 3 )
text = "Character talks with text above"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="item2" type="Area2D" parent="Hotspots"]
pause_mode = 1
position = Vector2( 189.644, 0 )
script = ExtResource( 5 )
global_id = "r1_wall_item2"
esc_script = "res://game/rooms/room01/esc/wall_item_popupdialog.esc"
tooltip_name = "Item on the wall"
default_action = "look"
dialog_color = Color( 1, 1, 1, 1 )
animations = null
[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 )
[node name="Position2D" type="Position2D" parent="Hotspots/item2"]
position = Vector2( 671.798, 373.035 )
script = ExtResource( 7 )
global_id = "r2_left_object_interaction"
[node name="Line2D" type="Line2D" parent="Hotspots/item2"]
position = Vector2( -4.23779, -267.828 )
points = PoolVector2Array( 634.097, 516.751, 578.861, 335.008, 701.805, 386.68, 696.459, 509.624, 634.097, 516.751 )
__meta__ = {
"_edit_use_anchors_": false,
"_editor_description_": ""
}
[node name="Label2" type="Label" parent="Hotspots/item2"]
margin_left = 556.218
margin_top = 265.925
margin_right = 752.218
margin_bottom = 279.925
[node name="item2" parent="Hotspots" instance=ExtResource( 9 )]
position = Vector2( 839.614, 146.832 )
global_id = "r1_wall_item2"
esc_script = "res://game/rooms/room01/esc/wall_item_popupdialog.esc"
[node name="Label" type="Label" parent="Hotspots/item2"]
margin_left = -105.12
margin_top = 121.762
margin_right = 122.88
margin_bottom = 142.762
custom_fonts/font = ExtResource( 3 )
text = "Character talks with popup"
__meta__ = {
"_edit_use_anchors_": false
"_edit_use_anchors_": false,
"_editor_description_": ""
}
[node name="player_start" type="Position2D" parent="."]
position = Vector2( 653.761, 443.306 )
position = Vector2( 172.471, 434.487 )
script = ExtResource( 7 )
global_id = "r1_start"
is_start_location = true
[node name="destination_point" type="Position2D" parent="."]
position = Vector2( 476.984, 487.146 )
[node name="orients_down_on_arrival" type="Position2D" parent="."]
position = Vector2( 400.129, 432.969 )
script = ExtResource( 7 )
global_id = "r1_destination_point"
interaction_direction = 4
[node name="destination_point2" type="Position2D" parent="."]
position = Vector2( 994.586, 458.862 )
[node name="set_angle_by_esc" type="Position2D" parent="."]
position = Vector2( 934.11, 502.959 )
script = ExtResource( 7 )
global_id = "r1_destination_point2"
player_orients_on_arrival = false
[node name="turn_to_r_door_by_esc" type="Position2D" parent="."]
position = Vector2( 660.468, 381.489 )
script = ExtResource( 7 )
global_id = "r1_destination_point3"
player_orients_on_arrival = false