Issue 335 (#384)
Co-authored-by: Dennis Ploeger <develop@dieploegers.de> Co-authored-by: dploeger <dploeger@users.noreply.github.com>
This commit is contained in:
@@ -57,6 +57,8 @@ func run(command_params: Array) -> int:
|
|||||||
escoria.main.scene_transition.fade_out()
|
escoria.main.scene_transition.fade_out()
|
||||||
yield(escoria.main.scene_transition, "transition_done")
|
yield(escoria.main.scene_transition, "transition_done")
|
||||||
|
|
||||||
|
escoria.inputs_manager.clear_stack()
|
||||||
|
|
||||||
escoria.main_menu_instance.hide()
|
escoria.main_menu_instance.hide()
|
||||||
|
|
||||||
var res_room = escoria.resource_cache.get_resource(command_params[0])
|
var res_room = escoria.resource_cache.get_resource(command_params[0])
|
||||||
|
|||||||
@@ -104,7 +104,8 @@ func perform_inputevent_on_object(
|
|||||||
global_position
|
global_position
|
||||||
|
|
||||||
# If clicked object not in inventory, player walks towards it
|
# If clicked object not in inventory, player walks towards it
|
||||||
if not escoria.inventory_manager.inventory_has(obj.global_id):
|
if not obj.node is ESCPlayer and \
|
||||||
|
not escoria.inventory_manager.inventory_has(obj.global_id):
|
||||||
var context = _walk_towards_object(
|
var context = _walk_towards_object(
|
||||||
obj,
|
obj,
|
||||||
event.position,
|
event.position,
|
||||||
|
|||||||
@@ -7,6 +7,9 @@ class_name ESCPlayer, "res://addons/escoria-core/design/esc_player.svg"
|
|||||||
# The node that references the camera position
|
# The node that references the camera position
|
||||||
export(NodePath) var camera_position_node
|
export(NodePath) var camera_position_node
|
||||||
|
|
||||||
|
# Wether the player can be selected like an item
|
||||||
|
export(bool) var selectable = false
|
||||||
|
|
||||||
|
|
||||||
# A player is always movable
|
# A player is always movable
|
||||||
func _init():
|
func _init():
|
||||||
@@ -15,8 +18,11 @@ func _init():
|
|||||||
|
|
||||||
# Ready function
|
# Ready function
|
||||||
func _ready():
|
func _ready():
|
||||||
# For ESCPlayer, avoid the CollisionShape2D used for movement to catch inputs
|
if selectable:
|
||||||
disconnect("input_event", self, "manage_input")
|
._ready()
|
||||||
|
else:
|
||||||
|
tooltip_name = ""
|
||||||
|
disconnect("input_event", self, "manage_input")
|
||||||
|
|
||||||
|
|
||||||
# Return the camera position if a camera_position_node exists or the
|
# Return the camera position if a camera_position_node exists or the
|
||||||
|
|||||||
@@ -94,6 +94,11 @@ func register_background(background: ESCBackground):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
# Clear the stack of hovered items
|
||||||
|
func clear_stack():
|
||||||
|
hover_stack = []
|
||||||
|
|
||||||
|
|
||||||
# The background was clicked with the LMB
|
# The background was clicked with the LMB
|
||||||
#
|
#
|
||||||
# #### Parameters
|
# #### Parameters
|
||||||
|
|||||||
@@ -79,3 +79,10 @@ Connect the item signals to the local methods
|
|||||||
func register_background(background: ESCBackground)
|
func register_background(background: ESCBackground)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### clear\_stack
|
||||||
|
|
||||||
|
```gdscript
|
||||||
|
func clear_stack()
|
||||||
|
```
|
||||||
|
|
||||||
|
Clear the stack of hovered items
|
||||||
@@ -18,6 +18,14 @@ export var camera_position_node = ""
|
|||||||
|
|
||||||
The node that references the camera position
|
The node that references the camera position
|
||||||
|
|
||||||
|
### selectable
|
||||||
|
|
||||||
|
```gdscript
|
||||||
|
export var selectable = false
|
||||||
|
```
|
||||||
|
|
||||||
|
Wether the player can be selected like an item
|
||||||
|
|
||||||
## Method Descriptions
|
## Method Descriptions
|
||||||
|
|
||||||
### get\_camera\_pos
|
### get\_camera\_pos
|
||||||
|
|||||||
3
game/characters/mark/mark.esc
Normal file
3
game/characters/mark/mark.esc
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
:look
|
||||||
|
|
||||||
|
say player "That's a-me, Mark-io."
|
||||||
@@ -9,202 +9,206 @@
|
|||||||
[ext_resource path="res://game/characters/mark/png/mark_talk_right.png" type="Texture" id=7]
|
[ext_resource path="res://game/characters/mark/png/mark_talk_right.png" type="Texture" id=7]
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=1]
|
[sub_resource type="AtlasTexture" id=1]
|
||||||
atlas = ExtResource( 2 )
|
|
||||||
region = Rect2( 0, 0, 24, 70 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=2]
|
|
||||||
atlas = ExtResource( 2 )
|
|
||||||
region = Rect2( 24, 0, 24, 70 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=3]
|
|
||||||
atlas = ExtResource( 2 )
|
|
||||||
region = Rect2( 48, 0, 24, 70 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=4]
|
|
||||||
atlas = ExtResource( 4 )
|
|
||||||
region = Rect2( 48, 0, 24, 70 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=5]
|
|
||||||
atlas = ExtResource( 7 )
|
|
||||||
region = Rect2( 0, 0, 24, 70 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=6]
|
|
||||||
atlas = ExtResource( 7 )
|
|
||||||
region = Rect2( 24, 0, 24, 70 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=7]
|
|
||||||
atlas = ExtResource( 7 )
|
|
||||||
region = Rect2( 48, 0, 24, 70 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=8]
|
|
||||||
atlas = ExtResource( 7 )
|
|
||||||
region = Rect2( 72, 0, 24, 70 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=9]
|
|
||||||
atlas = ExtResource( 7 )
|
|
||||||
region = Rect2( 96, 0, 24, 70 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=10]
|
|
||||||
atlas = ExtResource( 4 )
|
|
||||||
region = Rect2( 144, 0, 24, 70 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=11]
|
|
||||||
atlas = ExtResource( 4 )
|
|
||||||
region = Rect2( 168, 0, 24, 70 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=12]
|
|
||||||
atlas = ExtResource( 4 )
|
|
||||||
region = Rect2( 192, 0, 24, 70 )
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=13]
|
|
||||||
atlas = ExtResource( 4 )
|
atlas = ExtResource( 4 )
|
||||||
region = Rect2( 216, 0, 24, 70 )
|
region = Rect2( 216, 0, 24, 70 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=14]
|
[sub_resource type="AtlasTexture" id=2]
|
||||||
atlas = ExtResource( 4 )
|
atlas = ExtResource( 4 )
|
||||||
region = Rect2( 240, 0, 24, 70 )
|
region = Rect2( 240, 0, 24, 70 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=15]
|
[sub_resource type="AtlasTexture" id=3]
|
||||||
atlas = ExtResource( 4 )
|
atlas = ExtResource( 4 )
|
||||||
region = Rect2( 264, 0, 24, 70 )
|
region = Rect2( 264, 0, 24, 70 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=16]
|
[sub_resource type="AtlasTexture" id=4]
|
||||||
atlas = ExtResource( 4 )
|
atlas = ExtResource( 4 )
|
||||||
region = Rect2( 288, 0, 24, 70 )
|
region = Rect2( 288, 0, 24, 70 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=17]
|
[sub_resource type="AtlasTexture" id=5]
|
||||||
atlas = ExtResource( 4 )
|
atlas = ExtResource( 4 )
|
||||||
region = Rect2( 312, 0, 24, 70 )
|
region = Rect2( 312, 0, 24, 70 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=18]
|
[sub_resource type="AtlasTexture" id=6]
|
||||||
atlas = ExtResource( 4 )
|
atlas = ExtResource( 4 )
|
||||||
region = Rect2( 0, 0, 24, 70 )
|
region = Rect2( 0, 0, 24, 70 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=19]
|
[sub_resource type="AtlasTexture" id=7]
|
||||||
atlas = ExtResource( 4 )
|
atlas = ExtResource( 4 )
|
||||||
region = Rect2( 336, 0, 24, 70 )
|
region = Rect2( 336, 0, 24, 70 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=20]
|
[sub_resource type="AtlasTexture" id=8]
|
||||||
atlas = ExtResource( 4 )
|
atlas = ExtResource( 4 )
|
||||||
region = Rect2( 360, 0, 24, 70 )
|
region = Rect2( 360, 0, 24, 70 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=21]
|
[sub_resource type="AtlasTexture" id=9]
|
||||||
atlas = ExtResource( 4 )
|
atlas = ExtResource( 4 )
|
||||||
region = Rect2( 384, 0, 24, 70 )
|
region = Rect2( 384, 0, 24, 70 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=22]
|
[sub_resource type="AtlasTexture" id=10]
|
||||||
atlas = ExtResource( 4 )
|
atlas = ExtResource( 4 )
|
||||||
region = Rect2( 72, 0, 24, 70 )
|
region = Rect2( 72, 0, 24, 70 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=23]
|
[sub_resource type="AtlasTexture" id=11]
|
||||||
atlas = ExtResource( 4 )
|
atlas = ExtResource( 4 )
|
||||||
region = Rect2( 96, 0, 24, 70 )
|
region = Rect2( 96, 0, 24, 70 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=24]
|
[sub_resource type="AtlasTexture" id=12]
|
||||||
atlas = ExtResource( 4 )
|
atlas = ExtResource( 4 )
|
||||||
region = Rect2( 24, 0, 24, 70 )
|
region = Rect2( 24, 0, 24, 70 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=25]
|
[sub_resource type="AtlasTexture" id=13]
|
||||||
atlas = ExtResource( 5 )
|
atlas = ExtResource( 5 )
|
||||||
region = Rect2( 0, 0, 24, 70 )
|
region = Rect2( 0, 0, 24, 70 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=26]
|
[sub_resource type="AtlasTexture" id=14]
|
||||||
atlas = ExtResource( 5 )
|
atlas = ExtResource( 5 )
|
||||||
region = Rect2( 24, 0, 24, 70 )
|
region = Rect2( 24, 0, 24, 70 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=27]
|
[sub_resource type="AtlasTexture" id=15]
|
||||||
atlas = ExtResource( 5 )
|
atlas = ExtResource( 5 )
|
||||||
region = Rect2( 48, 0, 24, 70 )
|
region = Rect2( 48, 0, 24, 70 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=28]
|
[sub_resource type="AtlasTexture" id=16]
|
||||||
atlas = ExtResource( 6 )
|
atlas = ExtResource( 6 )
|
||||||
region = Rect2( 0, 0, 24, 70 )
|
region = Rect2( 0, 0, 24, 70 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=29]
|
[sub_resource type="AtlasTexture" id=17]
|
||||||
atlas = ExtResource( 6 )
|
atlas = ExtResource( 6 )
|
||||||
region = Rect2( 24, 0, 24, 70 )
|
region = Rect2( 24, 0, 24, 70 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=30]
|
[sub_resource type="AtlasTexture" id=18]
|
||||||
atlas = ExtResource( 4 )
|
atlas = ExtResource( 4 )
|
||||||
region = Rect2( 120, 0, 24, 70 )
|
region = Rect2( 120, 0, 24, 70 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=19]
|
||||||
|
atlas = ExtResource( 4 )
|
||||||
|
region = Rect2( 48, 0, 24, 70 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=20]
|
||||||
|
atlas = ExtResource( 7 )
|
||||||
|
region = Rect2( 0, 0, 24, 70 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=21]
|
||||||
|
atlas = ExtResource( 7 )
|
||||||
|
region = Rect2( 24, 0, 24, 70 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=22]
|
||||||
|
atlas = ExtResource( 7 )
|
||||||
|
region = Rect2( 48, 0, 24, 70 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=23]
|
||||||
|
atlas = ExtResource( 7 )
|
||||||
|
region = Rect2( 72, 0, 24, 70 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=24]
|
||||||
|
atlas = ExtResource( 7 )
|
||||||
|
region = Rect2( 96, 0, 24, 70 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=25]
|
||||||
|
atlas = ExtResource( 4 )
|
||||||
|
region = Rect2( 144, 0, 24, 70 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=26]
|
||||||
|
atlas = ExtResource( 4 )
|
||||||
|
region = Rect2( 168, 0, 24, 70 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=27]
|
||||||
|
atlas = ExtResource( 4 )
|
||||||
|
region = Rect2( 192, 0, 24, 70 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=28]
|
||||||
|
atlas = ExtResource( 2 )
|
||||||
|
region = Rect2( 0, 0, 24, 70 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=29]
|
||||||
|
atlas = ExtResource( 2 )
|
||||||
|
region = Rect2( 24, 0, 24, 70 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=30]
|
||||||
|
atlas = ExtResource( 2 )
|
||||||
|
region = Rect2( 48, 0, 24, 70 )
|
||||||
|
|
||||||
[sub_resource type="SpriteFrames" id=31]
|
[sub_resource type="SpriteFrames" id=31]
|
||||||
animations = [ {
|
animations = [ {
|
||||||
"frames": [ SubResource( 1 ), SubResource( 2 ), SubResource( 3 ), SubResource( 2 ), SubResource( 3 ) ],
|
"frames": [ SubResource( 1 ), SubResource( 2 ), SubResource( 3 ), SubResource( 4 ), SubResource( 5 ) ],
|
||||||
"loop": true,
|
|
||||||
"name": "speak_down",
|
|
||||||
"speed": 6.0
|
|
||||||
}, {
|
|
||||||
"frames": [ SubResource( 4 ) ],
|
|
||||||
"loop": true,
|
|
||||||
"name": "idle_right",
|
|
||||||
"speed": 5.0
|
|
||||||
}, {
|
|
||||||
"frames": [ SubResource( 5 ), SubResource( 6 ), SubResource( 7 ), SubResource( 8 ), SubResource( 9 ) ],
|
|
||||||
"loop": true,
|
|
||||||
"name": "speak_right",
|
|
||||||
"speed": 5.0
|
|
||||||
}, {
|
|
||||||
"frames": [ SubResource( 10 ), SubResource( 11 ), SubResource( 12 ), SubResource( 11 ) ],
|
|
||||||
"loop": true,
|
|
||||||
"name": "walk_down",
|
|
||||||
"speed": 6.0
|
|
||||||
}, {
|
|
||||||
"frames": [ SubResource( 13 ), SubResource( 14 ), SubResource( 15 ), SubResource( 16 ), SubResource( 17 ) ],
|
|
||||||
"loop": true,
|
"loop": true,
|
||||||
"name": "walk_right",
|
"name": "walk_right",
|
||||||
"speed": 6.0
|
"speed": 6.0
|
||||||
}, {
|
}, {
|
||||||
"frames": [ SubResource( 18 ) ],
|
"frames": [ SubResource( 6 ) ],
|
||||||
"loop": true,
|
"loop": true,
|
||||||
"name": "idle_down",
|
"name": "idle_down",
|
||||||
"speed": 5.0
|
"speed": 5.0
|
||||||
}, {
|
}, {
|
||||||
"frames": [ SubResource( 19 ), SubResource( 20 ), SubResource( 21 ), SubResource( 20 ) ],
|
"frames": [ SubResource( 7 ), SubResource( 8 ), SubResource( 9 ), SubResource( 8 ) ],
|
||||||
"loop": true,
|
"loop": true,
|
||||||
"name": "walk_up",
|
"name": "walk_up",
|
||||||
"speed": 6.0
|
"speed": 6.0
|
||||||
}, {
|
}, {
|
||||||
"frames": [ SubResource( 22 ) ],
|
"frames": [ SubResource( 10 ) ],
|
||||||
"loop": true,
|
"loop": true,
|
||||||
"name": "idle_up",
|
"name": "idle_up",
|
||||||
"speed": 5.0
|
"speed": 5.0
|
||||||
}, {
|
}, {
|
||||||
"frames": [ SubResource( 23 ) ],
|
"frames": [ SubResource( 11 ) ],
|
||||||
"loop": true,
|
"loop": true,
|
||||||
"name": "idle_left",
|
"name": "idle_left",
|
||||||
"speed": 5.0
|
"speed": 5.0
|
||||||
}, {
|
}, {
|
||||||
"frames": [ SubResource( 24 ) ],
|
"frames": [ SubResource( 12 ) ],
|
||||||
"loop": true,
|
"loop": true,
|
||||||
"name": "idle_down_right",
|
"name": "idle_down_right",
|
||||||
"speed": 5.0
|
"speed": 5.0
|
||||||
}, {
|
}, {
|
||||||
"frames": [ SubResource( 25 ), SubResource( 26 ), SubResource( 27 ) ],
|
"frames": [ SubResource( 13 ), SubResource( 14 ), SubResource( 15 ) ],
|
||||||
"loop": true,
|
"loop": true,
|
||||||
"name": "speak_down_right",
|
"name": "speak_down_right",
|
||||||
"speed": 6.0
|
"speed": 6.0
|
||||||
}, {
|
}, {
|
||||||
"frames": [ SubResource( 28 ), SubResource( 29 ), SubResource( 28 ), SubResource( 29 ), SubResource( 29 ) ],
|
"frames": [ SubResource( 16 ), SubResource( 17 ), SubResource( 16 ), SubResource( 17 ), SubResource( 17 ) ],
|
||||||
"loop": true,
|
"loop": true,
|
||||||
"name": "speak_up",
|
"name": "speak_up",
|
||||||
"speed": 3.0
|
"speed": 3.0
|
||||||
}, {
|
}, {
|
||||||
"frames": [ SubResource( 30 ) ],
|
"frames": [ SubResource( 18 ) ],
|
||||||
"loop": true,
|
"loop": true,
|
||||||
"name": "idle_down_left",
|
"name": "idle_down_left",
|
||||||
"speed": 5.0
|
"speed": 5.0
|
||||||
|
}, {
|
||||||
|
"frames": [ SubResource( 19 ) ],
|
||||||
|
"loop": true,
|
||||||
|
"name": "idle_right",
|
||||||
|
"speed": 5.0
|
||||||
|
}, {
|
||||||
|
"frames": [ SubResource( 20 ), SubResource( 21 ), SubResource( 22 ), SubResource( 23 ), SubResource( 24 ) ],
|
||||||
|
"loop": true,
|
||||||
|
"name": "speak_right",
|
||||||
|
"speed": 5.0
|
||||||
|
}, {
|
||||||
|
"frames": [ SubResource( 25 ), SubResource( 26 ), SubResource( 27 ), SubResource( 26 ) ],
|
||||||
|
"loop": true,
|
||||||
|
"name": "walk_down",
|
||||||
|
"speed": 6.0
|
||||||
|
}, {
|
||||||
|
"frames": [ SubResource( 28 ), SubResource( 29 ), SubResource( 30 ), SubResource( 29 ), SubResource( 30 ) ],
|
||||||
|
"loop": true,
|
||||||
|
"name": "speak_down",
|
||||||
|
"speed": 6.0
|
||||||
} ]
|
} ]
|
||||||
|
|
||||||
[sub_resource type="CapsuleShape2D" id=32]
|
[sub_resource type="CapsuleShape2D" id=32]
|
||||||
height = 0.0
|
radius = 38.2347
|
||||||
|
height = 217.78
|
||||||
|
|
||||||
[node name="mark" type="Area2D"]
|
[node name="mark" type="Area2D"]
|
||||||
pause_mode = 1
|
pause_mode = 1
|
||||||
script = ExtResource( 1 )
|
script = ExtResource( 1 )
|
||||||
global_id = "player"
|
global_id = "player"
|
||||||
|
esc_script = "res://game/characters/mark/mark.esc"
|
||||||
is_movable = true
|
is_movable = true
|
||||||
|
tooltip_name = "Me"
|
||||||
dialog_color = Color( 1, 1, 1, 1 )
|
dialog_color = Color( 1, 1, 1, 1 )
|
||||||
|
selectable = true
|
||||||
animations = ExtResource( 3 )
|
animations = ExtResource( 3 )
|
||||||
|
|
||||||
[node name="sprite" type="AnimatedSprite" parent="."]
|
[node name="sprite" type="AnimatedSprite" parent="."]
|
||||||
@@ -214,6 +218,7 @@ frames = SubResource( 31 )
|
|||||||
animation = "idle_down"
|
animation = "idle_down"
|
||||||
|
|
||||||
[node name="collision" type="CollisionShape2D" parent="."]
|
[node name="collision" type="CollisionShape2D" parent="."]
|
||||||
|
position = Vector2( 0.455139, -138.362 )
|
||||||
shape = SubResource( 32 )
|
shape = SubResource( 32 )
|
||||||
|
|
||||||
[node name="debug" type="Label" parent="."]
|
[node name="debug" type="Label" parent="."]
|
||||||
|
|||||||
Reference in New Issue
Block a user