Deleted ESCHotspot (use ESCItem instead)

Moved duplicated movement code from ESCPlayer and ESCItem/ESCHotspot to its own script.
Added talking animations management.
Fixed bug: character was turning to last_direction after talking, if coming from another direction than speaking direction.
Continued removing unfree stuff.
This commit is contained in:
Julian Murgia
2021-01-12 23:05:23 +01:00
parent 933122f085
commit ff56816205
73 changed files with 1211 additions and 1652 deletions

View File

@@ -93,13 +93,20 @@ points = PoolVector2Array( 1175.07, 620.086, 1171.24, 311.267, 1274.8, 356.87, 1
[node name="bridge" parent="." instance=ExtResource( 2 )]
global_id = "r3_bridge"
interact_positions = {
"default": Vector2( 0, 0 )
}
[node name="button" type="Sprite" parent="."]
[node name="button" type="Area2D" parent="."]
script = ExtResource( 4 )
global_id = "r3_button"
esc_script = "res://game/rooms/room3/esc/button.esc"
tooltip_name = "button"
tooltip_name = "Button"
default_action = "use"
dialog_color = Color( 1, 1, 1, 1 )
interact_positions = {
"default": Vector2( 347.767, 378.011 )
}
[node name="lines" type="Line2D" parent="button"]
position = Vector2( 0, -266.591 )
@@ -128,7 +135,5 @@ anims/button_repaired = SubResource( 7 )
[node name="interact_pos" type="Position2D" parent="button"]
position = Vector2( 347.767, 378.011 )
[node name="area" type="Area2D" parent="button"]
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="button/area"]
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="button"]
polygon = PoolVector2Array( 319.633, 122.126, 320.427, 177.685, 371.224, 176.098, 372.811, 121.332 )

View File

@@ -1,6 +1,6 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://addons/escoria-core/game/core-scripts/eschotspot.gd" type="Script" id=1]
[ext_resource path="res://addons/escoria-core/game/core-scripts/escitem.gd" type="Script" id=1]
[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 28.6442, 23.5021 )
@@ -38,10 +38,16 @@ tracks/0/keys = {
[node name="button" type="Area2D"]
position = Vector2( 346.18, 151.013 )
script = ExtResource( 1 )
__meta__ = {
"_editor_description_": ""
}
global_id = "button"
esc_script = "res://game/rooms/room3/esc/button.esc"
tooltip_name = "Button"
dialog_color = Color( 1, 1, 1, 1 )
interact_positions = {
"default": Vector2( 346.18, 151.013 )
}
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource( 1 )

View File

@@ -17,6 +17,11 @@
teleport player r3_r_exit
# Set player look left
set_angle player 270
# If bridge not closed
> [!r3_bridge_closed]
set_interactive r3_right_platform false
stop
> [!last_scene]
teleport player player_start

View File

@@ -1,9 +1,10 @@
[gd_scene load_steps=6 format=2]
[gd_scene load_steps=7 format=2]
[ext_resource path="res://game/rooms/room3/walkable_area.tscn" type="PackedScene" id=1]
[ext_resource path="res://game/rooms/room3/background.tscn" type="PackedScene" id=2]
[ext_resource path="res://addons/escoria-core/game/core-scripts/eschotspot.gd" type="Script" id=3]
[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/escitem.gd" type="Script" id=5]
[ext_resource path="res://addons/escoria-core/game/core-scripts/escroom.gd" type="Script" id=6]
[node name="room3" type="Node2D"]
@@ -11,27 +12,27 @@ script = ExtResource( 6 )
global_id = "room3"
esc_script = "res://game/rooms/room3/esc/room3_bridge.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 = 40.0
margin_bottom = 14.0
custom_fonts/font = ExtResource( 3 )
text = "ROOM 3"
[node name="walkable_area" parent="." instance=ExtResource( 1 )]
[node name="Hotspots" type="Node2D" parent="."]
[node name="r_platform" type="Area2D" parent="Hotspots"]
script = ExtResource( 3 )
script = ExtResource( 5 )
__meta__ = {
"_editor_description_": ""
}
global_id = "r3_right_platform"
is_exit = false
esc_script = "res://game/rooms/room3/esc/right_platform.esc"
is_interactive = true
player_orients_on_arrival = true
interaction_direction = 0
tooltip_name = "Right platform"
default_action = ""
combine_if_action_used_among = PoolStringArray( )
dialog_color = Color( 1, 1, 1, 1 )
interact_positions = {
"default": Vector2( 430.893, 451.052 )
@@ -50,16 +51,14 @@ __meta__ = {
}
[node name="r_door" type="Area2D" parent="Hotspots"]
script = ExtResource( 3 )
script = ExtResource( 5 )
__meta__ = {
"_editor_description_": ""
}
global_id = "r3_r_exit"
is_exit = true
esc_script = "res://game/rooms/room3/esc/right_exit.esc"
is_interactive = true
player_orients_on_arrival = true
interaction_direction = 0
is_exit = true
tooltip_name = "Exit"
default_action = ""
combine_if_action_used_among = PoolStringArray( )
dialog_color = Color( 1, 1, 1, 1 )
interact_positions = {
"default": Vector2( 1225.47, 353.99 )
@@ -72,16 +71,14 @@ polygon = PoolVector2Array( 1177.94, 348.61, 1175.95, 45.3759, 1276.06, 92.0953,
position = Vector2( 1225.47, 353.99 )
[node name="l_door" type="Area2D" parent="Hotspots"]
script = ExtResource( 3 )
script = ExtResource( 5 )
__meta__ = {
"_editor_description_": ""
}
global_id = "r3_l_exit"
is_exit = true
esc_script = "res://game/rooms/room3/esc/left_exit.esc"
is_interactive = true
player_orients_on_arrival = true
interaction_direction = 0
is_exit = true
tooltip_name = "Exit"
default_action = ""
combine_if_action_used_among = PoolStringArray( )
dialog_color = Color( 1, 1, 1, 1 )
interact_positions = {
"default": Vector2( 44.1375, 384.691 )