Event flags implementation (#382)

* Added event flags
* Added transition ESC command
* Also edited .gitignore to ignore .translation files
* docs: Automatic update of API docs

Co-authored-by: StraToN <StraToN@users.noreply.github.com>
This commit is contained in:
Julian Murgia
2021-09-07 09:13:09 +02:00
committed by GitHub
parent 903422960a
commit b4bf5b82d6
51 changed files with 1071 additions and 305 deletions

1
.gitignore vendored
View File

@@ -1,3 +1,4 @@
bin
*.import
.import
*.translation

View File

@@ -173,7 +173,6 @@ func _test_event_flags() -> bool:
:test | TK
:test2 | TK NO_TT
:test3 | TK NO_TT NO_HUD
:test4 | TK NO_TT CUT_BLACK
"""
var script = escoria.esc_compiler.compile(esc.split("\n"))
@@ -200,12 +199,6 @@ func _test_event_flags() -> bool:
assert(subject.flags & ESCEvent.FLAG_NO_TT != 0)
assert(subject.flags & ESCEvent.FLAG_NO_HUD != 0)
subject = script.events["test4"]
assert(subject.name == "test4")
assert(subject.flags & ESCEvent.FLAG_TK != 0)
assert(subject.flags & ESCEvent.FLAG_NO_TT != 0)
assert(subject.flags & ESCEvent.FLAG_NO_HUD == 0)
assert(subject.flags & ESCEvent.FLAG_CUT_BLACK != 0)
return true

View File

@@ -1,8 +1,12 @@
# `change_scene path run_events`
# `change_scene path [disable_automatic_transition] [run_events]`
#
# Loads a new scene, specified by "path". The `run_events` variable is a
# boolean (default true) which you never want to set manually! It's there only
# to benefit save games, so they don't conflict with the scene's events.
# Loads a new scene, specified by "path".
# The `disable_automatic_transition` is a boolean (default false) can be set
# to true to disable automatic transitions between scenes, to allow you
# to control your transitions manually using the `transition` command.
# The `run_events` variable is a boolean (default true) which you never want
# to set manually! It's there only to benefit save games, so they don't
# conflict with the scene's events.
#
# @ESC
extends ESCBaseCommand
@@ -13,8 +17,8 @@ class_name ChangeSceneCommand
func configure() -> ESCCommandArgumentDescriptor:
return ESCCommandArgumentDescriptor.new(
1,
[TYPE_STRING, TYPE_BOOL],
[null, true]
[TYPE_STRING, TYPE_BOOL, TYPE_BOOL],
[null, false, true]
)
@@ -42,9 +46,11 @@ func validate(arguments: Array) -> bool:
# Run the command
func run(command_params: Array) -> int:
escoria.logger.info("Changing scene to %s (run_events = %s)" % [
escoria.logger.info(
"Changing scene to %s (disable_automatic_transition = %s, run_events = %s)" % [
command_params[0],
command_params[1]
command_params[1],
command_params[2]
])
if escoria.main.current_scene:
@@ -54,7 +60,8 @@ func run(command_params: Array) -> int:
true
)
escoria.main.scene_transition.fade_out()
if !command_params[1]:
escoria.main.scene_transition.transition_out()
yield(escoria.main.scene_transition, "transition_done")
escoria.inputs_manager.clear_stack()
@@ -85,7 +92,7 @@ func run(command_params: Array) -> int:
escoria.main.set_scene(room_scene)
if "esc_script" in room_scene and room_scene.esc_script \
and command_params[1]:
and command_params[2]:
var script = escoria.esc_compiler.load_esc_file(
room_scene.esc_script
@@ -99,7 +106,8 @@ func run(command_params: Array) -> int:
if rc[0] != ESCExecution.RC_OK:
return rc[0]
escoria.main.scene_transition.fade_in()
if !command_params[1]:
escoria.main.scene_transition.transition_in()
yield(escoria.main.scene_transition, "transition_done")
if script.events.has("ready"):
@@ -110,6 +118,11 @@ func run(command_params: Array) -> int:
if rc[0] != ESCExecution.RC_OK:
return rc[0]
else:
if !command_params[1]:
escoria.main.scene_transition.transition_in()
yield(escoria.main.scene_transition, "transition_done")
# Clear queued resources
escoria.resource_cache.clear()

View File

@@ -0,0 +1,45 @@
# `transition transition_name in|out`
#
# Performs a transition in our out manually.
#
# @ESC
extends ESCBaseCommand
class_name TransitionCommand
# Return the descriptor of the arguments of this command
func configure() -> ESCCommandArgumentDescriptor:
return ESCCommandArgumentDescriptor.new(
2,
[TYPE_STRING, TYPE_STRING],
[null, null]
)
# Validate wether the given arguments match the command descriptor
func validate(arguments: Array):
if not escoria.main.scene_transition.has_transition(arguments[0]):
escoria.logger.report_errors(
"transition: argument invalid",
[
"transition with name '%s' doesn't exist" % arguments[0]
]
)
return false
if not arguments[1] in ["in", "out"]:
escoria.logger.report_errors(
"transition: argument invalid",
[
"'in' or 'out' expected, but got '%s'" % arguments[1]
]
)
return false
return .validate(arguments)
# Run the command
func run(command_params: Array) -> int:
var transition_player = escoria.main.scene_transition
transition_player.call("transition_%s" % command_params[1], command_params[0])
var animation_finished = yield(transition_player, "transition_done")
return ESCExecution.RC_OK

View File

@@ -12,8 +12,8 @@ class_name ESCEvent
# Regex identifying an ESC event
const REGEX = \
'^:(?<name>[^|]+)( \\|(?<flags>( ' + \
'(TK|NO_TT|NO_HUD|NO_SAVE|CUT_BLACK|LEAVE_BLACK)' + \
'^:(?<name>[^|]+)( \\|\\s*(?<flags>( ' + \
'(TK|NO_TT|NO_HUD|NO_SAVE)' + \
')+))?$'
@@ -28,19 +28,11 @@ const REGEX = \
# disable input for skipping dialog.
# * NO_SAVE: disables saving. Use this in cut scenes and anywhere a
# badly-timed autosave would leave your game in a messed-up state.
# * CUT_BLACK: applies only to `:setup`. It makes the screen go black
# during the setup phase. You will probably see a quick black flash, so use
# it only if you prefer it over the standard cut.
# * LEAVE_BLACK: applies only to `:setup`. In case your `:ready` starts with
# `cut_scene telon fade_in`, you must apply this flag or you will see a
# flash of your new scene before going black again for the fade_in.
enum {
FLAG_TK = 1,
FLAG_NO_TT = 2,
FLAG_NO_HUD = 4,
FLAG_NO_SAVE = 8,
FLAG_CUT_BLACK = 16,
FLAG_LEAVE_BLACK = 32
FLAG_NO_SAVE = 8
}
@@ -74,10 +66,6 @@ func _init(event_string: String):
self.flags |= FLAG_NO_HUD
if "NO_SAVE" in _flags:
self.flags |= FLAG_NO_SAVE
if "CUT_BLACK" in _flags:
self.flags |= FLAG_CUT_BLACK
if "LEAVE_BLACK" in _flags:
self.flags |= FLAG_LEAVE_BLACK
else:
escoria.logger.report_errors(
"Invalid event detected: %s" % event_string,

View File

@@ -96,6 +96,12 @@ func perform_inputevent_on_object(
escoria.logger.info("%s left-clicked with event " % obj.global_id, [event])
var event_flags = 0
var has_current_action: bool = false
if obj.events.has(escoria.action_manager.current_action):
event_flags = obj.events[escoria.action_manager.current_action].flags
has_current_action = true
# Don't interact after player movement towards object
# (because object is inactive for example)
var dont_interact = false
@@ -105,7 +111,8 @@ func perform_inputevent_on_object(
# If clicked object not in inventory, player walks towards it
if not obj.node is ESCPlayer and \
not escoria.inventory_manager.inventory_has(obj.global_id):
not escoria.inventory_manager.inventory_has(obj.global_id) and \
(not has_current_action or not event_flags & ESCEvent.FLAG_TK):
var context = _walk_towards_object(
obj,
event.position,
@@ -131,6 +138,50 @@ func perform_inputevent_on_object(
# If player has arrived at the position he was supposed to reach
# so he can interact
if player_global_pos == destination_position:
# If NO_TT flag is active, hide tooltip and connect for
# event finished to show it back
if event_flags & ESCEvent.FLAG_NO_TT \
and not escoria.event_manager.is_connected(
"event_finished",
self,
"_on_no_tooltip_event_finished"
):
escoria.main.current_scene.game.tooltip_node.hide()
escoria.event_manager.connect(
"event_finished",
self,
"_on_no_tooltip_event_finished"
)
if event_flags & ESCEvent.FLAG_NO_HUD and \
not escoria.event_manager.is_connected(
"event_finished",
self,
"_on_no_hud_event_finished"
):
escoria.main.current_scene.game.hide_ui()
escoria.event_manager.connect(
"event_finished",
self,
"_on_no_hud_event_finished"
)
if event_flags & ESCEvent.FLAG_NO_SAVE and \
not escoria.event_manager.is_connected(
"event_finished",
self,
"_on_no_save_event_finished"
):
escoria.save_manager.save_enabled = false
escoria.event_manager.connect(
"event_finished",
self,
"_on_no_save_event_finished"
)
pass
# Manage exits
if obj.node.is_exit and escoria.action_manager.current_action \
in ["", "walk"]:
@@ -246,3 +297,63 @@ func _walk_towards_object(
walk_context.dont_interact_on_arrival = true
return context
# Called when an event having "NO_TT" flag is finished.
#
# ## Parameters
#
# - _return_code: The ESCExecution return code sent by the events manager.
# - _event_name: the name of the event
func _on_no_tooltip_event_finished(_return_code: int, _event_name: String):
escoria.main.current_scene.game.tooltip_node.show()
if escoria.event_manager.is_connected(
"event_finished",
self,
"_on_no_tooltip_event_finished"
):
escoria.event_manager.disconnect(
"event_finished",
self,
"_on_no_tooltip_event_finished"
)
# Called when an event having "NO_HUD" flag is finished.
#
# ## Parameters
#
# - _return_code: The ESCExecution return code sent by the events manager.
# - _event_name: the name of the event
func _on_no_hud_event_finished(_return_code: int, _event_name: String):
escoria.main.current_scene.game.show_ui()
if escoria.event_manager.is_connected(
"event_finished",
self,
"_on_no_hud_event_finished"
):
escoria.event_manager.disconnect(
"event_finished",
self,
"_on_no_hud_event_finished"
)
# Called when an event having "NO_SAVE" flag is finished.
#
# ## Parameters
#
# - _return_code: The ESCExecution return code sent by the events manager.
# - _event_name: the name of the event
func _on_no_save_event_finished(_return_code: int, _event_name: String):
escoria.save_manager.save_enabled = true
if escoria.event_manager.is_connected(
"event_finished",
self,
"_on_no_save_event_finished"
):
escoria.event_manager.disconnect(
"event_finished",
self,
"_on_no_save_event_finished"
)

View File

@@ -1,6 +1,9 @@
# Saves and loads savegame and settings files
class_name ESCSaveManager
# If true, saving a game is enabled. Else, saving is disabled
var save_enabled: bool = true
# Variable containing the saves folder obtained from Project Settings
var save_folder: String
@@ -65,6 +68,12 @@ func save_game_exists(id: int) -> bool:
# - id: integer suffix of the savegame file
# - p_savename: name of the savegame
func save_game(id: int, p_savename: String):
if not save_enabled:
escoria.logger.debug(
"esc_save_data_resources.gd",
["Save requested while saving is not possible. Save canceled."])
return
var save_game := ESCSaveGame.new()
save_game.escoria_version = escoria.ESCORIA_VERSION
save_game.game_version = ProjectSettings.get_setting(

View File

@@ -1,40 +1,68 @@
# A transition player for scene changes
extends ColorRect
# Emitted when the transition was played
signal transition_done
# The name of the transition to play
# The name of the default transition to play
export(
String,
"fade_black",
"fade_white",
"transition_in",
"transition_out"
"curtain"
) var transition_name: String
# Reference to the _AnimationPlayer_ node
onready var _anim_player := $AnimationPlayer
# Fade in when the scene is starting
func _ready() -> void:
fade_in()
transition_in()
# Fade out the transition
func fade_out() -> void:
# Transition out
#
# ## Parameters
#
# - p_transition_name: name of the transition to play (if empty string, uses
# the default transition)
func transition_out(p_transition_name: String = "") -> void:
if p_transition_name.empty():
_anim_player.play(transition_name)
else:
_anim_player.play(p_transition_name)
yield(_anim_player, "animation_finished")
emit_signal("transition_done")
_anim_player.seek(0.0)
# Fade in the transition
func fade_in() -> void:
# Plays the Fade animation and wait until it finishes
# Transition in
#
# ## Parameters
#
# - p_transition_name: name of the transition to play (if empty string, uses
# the default transition)
func transition_in(p_transition_name: String = "") -> void:
if p_transition_name.empty():
_anim_player.play_backwards(transition_name)
else:
_anim_player.play_backwards(p_transition_name)
yield(_anim_player, "animation_finished")
emit_signal("transition_done")
_anim_player.seek(0.0)
# Returns true whether the transition scene has a transition corresponding
# to name provided.
#
# ## Parameters
#
# - p_name: The name of the transition to test
#
# *Returns* true if a transition exists with given name.
func has_transition(p_name: String) -> bool:
return _anim_player.has_animation(p_name)

View File

@@ -1,8 +1,47 @@
[gd_scene load_steps=7 format=2]
[gd_scene load_steps=6 format=2]
[ext_resource path="res://addons/escoria-core/game/scenes/transitions/transition.gd" type="Script" id=1]
[ext_resource path="res://addons/escoria-core/game/scenes/transitions/shaders/transition.material" type="Material" id=2]
[sub_resource type="Animation" id=3]
resource_name = "curtain"
tracks/0/type = "value"
tracks/0/path = NodePath(".:material:shader_param/cutoff")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 1 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ 0.0, 1.0 ]
}
tracks/1/type = "value"
tracks/1/path = NodePath(".:material:shader_param/color")
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": 0,
"values": [ Color( 0, 0, 0, 1 ) ]
}
tracks/2/type = "value"
tracks/2/path = NodePath(".:modulate")
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": 0,
"values": [ Color( 1, 1, 1, 1 ) ]
}
[sub_resource type="Animation" id=1]
resource_name = "fade_black"
length = 0.5
@@ -18,6 +57,30 @@ tracks/0/keys = {
"update": 0,
"values": [ Color( 0, 0, 0, 0 ), Color( 0, 0, 0, 1 ) ]
}
tracks/1/type = "value"
tracks/1/path = NodePath(".:material:shader_param/cutoff")
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": 0,
"values": [ 0.0 ]
}
tracks/2/type = "value"
tracks/2/path = NodePath(".:material:shader_param/color")
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": 0,
"values": [ Color( 0, 0, 0, 1 ) ]
}
[sub_resource type="Animation" id=2]
resource_name = "fade_white"
@@ -34,38 +97,33 @@ tracks/0/keys = {
"update": 0,
"values": [ Color( 1, 1, 1, 0 ), Color( 1, 1, 1, 1 ) ]
}
[sub_resource type="Animation" id=3]
resource_name = "transition_in"
tracks/0/type = "value"
tracks/0/path = NodePath(".:material:shader_param/cutoff")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 1 ),
"transitions": PoolRealArray( 1, 1 ),
tracks/1/type = "value"
tracks/1/path = NodePath(".:material:shader_param/cutoff")
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": 0,
"values": [ 0.0, 1.0 ]
"values": [ 0.0 ]
}
[sub_resource type="Animation" id=4]
resource_name = "transition_out"
tracks/0/type = "value"
tracks/0/path = NodePath(".:material:shader_param/cutoff")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 1 ),
"transitions": PoolRealArray( 1, 1 ),
tracks/2/type = "value"
tracks/2/path = NodePath(".:material:shader_param/color")
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": 0,
"values": [ 1.0, 0.0 ]
"values": [ Color( 1, 1, 1, 1 ) ]
}
[node name="scene_transition" type="ColorRect"]
modulate = Color( 0, 0, 0, 0 )
material = ExtResource( 2 )
anchor_right = 1.0
anchor_bottom = 1.0
@@ -74,10 +132,9 @@ script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
transition_name = "transition_out"
transition_name = "curtain"
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
anims/curtain = SubResource( 3 )
anims/fade_black = SubResource( 1 )
anims/fade_white = SubResource( 2 )
anims/transition_in = SubResource( 3 )
anims/transition_out = SubResource( 4 )

View File

@@ -178,6 +178,7 @@ func pause_game():
escoria.main.current_scene.show()
escoria.set_game_paused(false)
else:
$ui/pause_menu.set_save_enabled(escoria.save_manager.save_enabled)
$ui/pause_menu.show()
escoria.main.current_scene.game.get_node("camera").current = false
escoria.main.current_scene.game.hide_ui()

View File

@@ -159,6 +159,7 @@ func pause_game():
escoria.main.current_scene.game.show_ui()
escoria.main.current_scene.show()
else:
$ui/pause_menu.set_save_enabled(escoria.save_manager.save_enabled)
$ui/pause_menu.show()
escoria.main.current_scene.game.get_node("camera").current = false
escoria.main.current_scene.game.hide_ui()

View File

@@ -6,11 +6,15 @@
## Description
`change_scene path run_events`
`change_scene path [disable_automatic_transition] [run_events]`
Loads a new scene, specified by "path". The `run_events` variable is a
boolean (default true) which you never want to set manually! It's there only
to benefit save games, so they don't conflict with the scene's events.
Loads a new scene, specified by "path".
 The `disable_automatic_transition` is a boolean (default false) can be set
to true to disable automatic transitions between scenes, to allow you
to control your transitions manually using the `transition` command.
The `run_events` variable is a boolean (default true) which you never want
to set manually! It's there only to benefit save games, so they don't
conflict with the scene's events.
@ESC

View File

@@ -17,18 +17,6 @@ Events are triggered from various sources. Common events include
## Constants Descriptions
### FLAG\_CUT\_BLACK
```gdscript
const FLAG_CUT_BLACK: int = 16
```
### FLAG\_LEAVE\_BLACK
```gdscript
const FLAG_LEAVE_BLACK: int = 32
```
### FLAG\_NO\_HUD
```gdscript
@@ -56,7 +44,7 @@ const FLAG_TK: int = 1
### REGEX
```gdscript
const REGEX: String = "^:(?<name>[^|]+)( \\|(?<flags>( (TK|NO_TT|NO_HUD|NO_SAVE|CUT_BLACK|LEAVE_BLACK))+))?$"
const REGEX: String = "^:(?<name>[^|]+)( \\|\\s*(?<flags>( (TK|NO_TT|NO_HUD|NO_SAVE))+))?$"
```
Regex identifying an ESC event

View File

@@ -22,6 +22,14 @@ Template for settings filename
## Property Descriptions
### save\_enabled
```gdscript
var save_enabled: bool = true
```
If true, saving a game is enabled. Else, saving is disabled
### save\_folder
```gdscript

View File

@@ -0,0 +1,39 @@
<!-- Auto-generated from JSON by GDScript docs maker. Do not edit this document directly. -->
# TransitionCommand
**Extends:** [ESCBaseCommand](../ESCBaseCommand) < [Node](../Node)
## Description
`transition transition_name in|out`
Performs a transition in our out manually.
@ESC
## Method Descriptions
### configure
```gdscript
func configure() -> ESCCommandArgumentDescriptor
```
Return the descriptor of the arguments of this command
### validate
```gdscript
func validate(arguments: Array)
```
Validate wether the given arguments match the command descriptor
### run
```gdscript
func run(command_params: Array) -> var
```
Run the command

View File

@@ -18,21 +18,46 @@ export var transition_name: String = ""
## Method Descriptions
### fade\_out
### transition\_out
```gdscript
func fade_out() -> var
func transition_out(p_transition_name: String = "") -> var
```
Fade out the transition
Transition out
### fade\_in
## Parameters
- p_transition_name: name of the transition to play (if empty string, uses
the default transition)
### transition\_in
```gdscript
func fade_in() -> var
func transition_in(p_transition_name: String = "") -> var
```
Fade in the transition
Transition in
## Parameters
- p_transition_name: name of the transition to play (if empty string, uses
the default transition)
### has\_transition
```gdscript
func has_transition(p_name: String) -> bool
```
Returns true whether the transition scene has a transition corresponding
to name provided.
## Parameters
- p_name: The name of the transition to test
*Returns* true if a transition exists with given name.
## Signals

View File

@@ -193,11 +193,15 @@ to zoom into position.
Shift camera by `x` and `y` pixels over `time` seconds. `type` is any of the
Tween.TransitionType values without the prefix, eg. LINEAR, QUART or CIRC;
defaults to QUART.
#### <a name="ChangeSceneCommand.md"></a>`change_scene path run_events` [API-Doc](api/ChangeSceneCommand.md)
#### <a name="ChangeSceneCommand.md"></a>`change_scene path [disable_automatic_transition] [run_events]` [API-Doc](api/ChangeSceneCommand.md)
Loads a new scene, specified by "path". The `run_events` variable is a
boolean (default true) which you never want to set manually! It's there only
to benefit save games, so they don't conflict with the scene's events.
Loads a new scene, specified by "path".
 The `disable_automatic_transition` is a boolean (default false) can be set
to true to disable automatic transitions between scenes, to allow you
to control your transitions manually using the `transition` command.
The `run_events` variable is a boolean (default true) which you never want
to set manually! It's there only to benefit save games, so they don't
conflict with the scene's events.
#### <a name="CustomCommand.md"></a>`custom object node func_name [params]` [API-Doc](api/CustomCommand.md)
Calls the function `func_name` of the node `node` of object `object` with
@@ -344,6 +348,9 @@ Sets the position of object1 to the position of object2.
#### <a name="TeleportPosCommand.md"></a>`teleport_pos object1 x y` [API-Doc](api/TeleportPosCommand.md)
Sets the position of object1 to the position (x,y).
#### <a name="TransitionCommand.md"></a>`transition transition_name in|out` [API-Doc](api/TransitionCommand.md)
Performs a transition in our out manually.
#### <a name="TurnToCommand.md"></a>`turn_to object degrees [immediate]` [API-Doc](api/TurnToCommand.md)
Turns object to a degrees angle with a directions animation.

View File

@@ -3,7 +3,7 @@
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_inventory_item.gd" type="Script" id=1]
[ext_resource path="res://game/items/textures/genericItem_color_127.png" type="Texture" id=2]
[node name="empty_sheet" type="TextureButton"]
[node name="bottle" type="TextureButton"]
margin_right = 50.0
margin_bottom = 140.0
texture_normal = ExtResource( 2 )
@@ -11,4 +11,3 @@ script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
global_id = "r9_bottle"

View File

@@ -0,0 +1,25 @@
[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="r_door" type="Area2D"]
pause_mode = 1
script = ExtResource( 1 )
__meta__ = {
"_editor_description_": ""
}
global_id = "r1_r_exit"
esc_script = "res://game/rooms/room01/esc/right_exit.esc"
is_exit = true
tooltip_name = "Exit"
default_action = "walk"
dialog_color = Color( 1, 1, 1, 1 )
animations = null
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."]
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 )
script = ExtResource( 2 )

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=8 format=2]
[gd_scene load_steps=9 format=2]
[ext_resource path="res://game/rooms/room01/walkable_area.tscn" type="PackedScene" id=1]
[ext_resource path="res://game/rooms/room01/background.tscn" type="PackedScene" id=2]
@@ -7,6 +7,7 @@
[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]
[node name="room1" type="Node2D"]
script = ExtResource( 6 )
@@ -47,26 +48,7 @@ position = Vector2( 3.5636, 0 )
[node name="Hotspots" type="Node2D" parent="."]
[node name="r_door" type="Area2D" parent="Hotspots"]
pause_mode = 1
script = ExtResource( 5 )
__meta__ = {
"_editor_description_": ""
}
global_id = "r1_r_exit"
esc_script = "res://game/rooms/room01/esc/right_exit.esc"
is_exit = true
tooltip_name = "Exit"
default_action = "walk"
dialog_color = Color( 1, 1, 1, 1 )
animations = null
[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 )
[node name="Position2D" type="Position2D" parent="Hotspots/r_door"]
position = Vector2( 1225.47, 353.99 )
script = ExtResource( 7 )
[node name="r_door" parent="Hotspots" instance=ExtResource( 8 )]
[node name="item" type="Area2D" parent="Hotspots"]
pause_mode = 1

View File

@@ -21,3 +21,10 @@ points = PoolVector2Array( 6.61201, 704.409, 6.61203, 389.558, 87.755, 339.775,
__meta__ = {
"_editor_description_": ""
}
[node name="r_door" type="Line2D" parent="."]
position = Vector2( 0, -267.828 )
points = PoolVector2Array( 1175.07, 620.086, 1171.24, 311.267, 1274.8, 356.87, 1278.31, 672.412, 1188.64, 624.843 )
__meta__ = {
"_editor_description_": ""
}

View File

@@ -1,2 +1,3 @@
:exit_scene
set_sound_state bg_sound res://game/sfx/sounds/doorOpen_2.ogg false
change_scene "res://game/rooms/room11/room11.tscn"

View File

@@ -1,130 +1,25 @@
[gd_scene load_steps=4 format=2]
[gd_scene load_steps=3 format=2]
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_item.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" ]
}
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_location.gd" type="Script" id=2]
[node name="r_door" type="Area2D"]
pause_mode = 1
script = ExtResource( 1 )
global_id = "r9_door"
esc_script = "res://game/rooms/room9/esc/r9_door.esc"
tooltip_name = "Door"
default_action = "look"
__meta__ = {
"_editor_description_": ""
}
global_id = "r1_r_exit"
esc_script = "res://game/rooms/room01/esc/right_exit.esc"
is_exit = true
tooltip_name = "Exit"
default_action = "walk"
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 )
animations = null
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."]
polygon = PoolVector2Array( 1169.35, 41.7644, 1168.09, 347.925, 1275.18, 407.141, 1278.96, 88.3814 )
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 )
script = ExtResource( 2 )

View File

@@ -49,6 +49,7 @@ __meta__ = {
[node name="Hotspots" type="Node2D" parent="."]
[node name="l_door" type="Area2D" parent="Hotspots"]
pause_mode = 1
script = ExtResource( 7 )
global_id = "r10_l_exit"
esc_script = "res://game/rooms/room10/esc/left_exit.esc"
@@ -66,14 +67,15 @@ position = Vector2( 37.4521, 392.045 )
script = ExtResource( 5 )
[node name="r_door" parent="Hotspots" instance=ExtResource( 9 )]
global_id = "r10_r_exit"
esc_script = "res://game/rooms/room10/esc/right_exit.esc"
animations = null
[node name="Position2D" type="Position2D" parent="Hotspots/r_door"]
position = Vector2( 1198.65, 391.058 )
script = ExtResource( 5 )
[node name="button_stop_bg_music" parent="Hotspots" instance=ExtResource( 8 )]
pause_mode = 1
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"
@@ -95,6 +97,7 @@ __meta__ = {
}
[node name="button_play_bg_music" parent="Hotspots" instance=ExtResource( 8 )]
pause_mode = 1
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"
@@ -116,6 +119,7 @@ __meta__ = {
}
[node name="button_play_sound" parent="Hotspots" instance=ExtResource( 8 )]
pause_mode = 1
position = Vector2( 646.339, 154.97 )
global_id = "r10_btn_play_snd"
esc_script = "res://game/rooms/room10/esc/button_play_snd.esc"
@@ -137,6 +141,7 @@ __meta__ = {
}
[node name="button_accept_input" parent="Hotspots" instance=ExtResource( 8 )]
pause_mode = 1
position = Vector2( 823.113, 155.354 )
global_id = "test_accept_input"
esc_script = "res://game/rooms/room10/esc/button_accept_input_test.esc"
@@ -161,6 +166,7 @@ script = ExtResource( 5 )
global_id = "accept_input_location"
[node name="button_slide" parent="Hotspots" instance=ExtResource( 8 )]
pause_mode = 1
position = Vector2( 939.497, 154.301 )
global_id = "button_slide"
esc_script = "res://game/rooms/room10/esc/button_slide.esc"
@@ -184,6 +190,7 @@ script = ExtResource( 5 )
global_id = "slide_location"
[node name="button_turn_to" parent="Hotspots" instance=ExtResource( 8 )]
pause_mode = 1
position = Vector2( 1041.66, 152.721 )
global_id = "button_turn_to"
esc_script = "res://game/rooms/room10/esc/button_turn_to.esc"

View File

@@ -0,0 +1,30 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_background.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_": ""
}
[node name="r_door" type="Line2D" parent="."]
position = Vector2( 0, -267.828 )
points = PoolVector2Array( 1175.07, 620.086, 1171.24, 311.267, 1274.8, 356.87, 1278.31, 672.412, 1188.64, 624.843 )
__meta__ = {
"_editor_description_": ""
}

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/room10/room10.tscn"

View File

@@ -0,0 +1,5 @@
:use
transition curtain out
wait 2
transition fade_black in

View File

@@ -0,0 +1,3 @@
:look | NO_HUD
say player "NO_HUD"

View File

@@ -0,0 +1,3 @@
:look | NO_SAVE
say player "NO_SAVE"

View File

@@ -0,0 +1,3 @@
:look | NO_TT
say player "NO_TT."

View File

@@ -0,0 +1,3 @@
:look | TK
say player "TK"

View File

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

View File

@@ -0,0 +1,18 @@
:setup
set_state bg_music off false
> [eq ESC_LAST_SCENE room10]
teleport player r11_l_exit
# Set player look right
set_angle player 180
stop
> [eq ESC_LAST_SCENE room12]
teleport player r11_r_exit
# Set player look left
set_angle player 270
stop
> [!last_scene]
teleport player player_start
stop

View File

@@ -0,0 +1,20 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_item.gd" type="Script" id=1]
[node name="r_door" type="Area2D"]
pause_mode = 1
script = ExtResource( 1 )
__meta__ = {
"_editor_description_": ""
}
global_id = "r1_r_exit"
esc_script = "res://game/rooms/room01/esc/right_exit.esc"
is_exit = true
tooltip_name = "Exit"
default_action = "walk"
dialog_color = Color( 1, 1, 1, 1 )
animations = null
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."]
polygon = PoolVector2Array( 1177.94, 348.61, 1175.95, 45.3759, 1276.06, 92.0953, 1277.95, 399.407 )

View File

@@ -0,0 +1,243 @@
[gd_scene load_steps=11 format=2]
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_terrain.gd" type="Script" id=1]
[ext_resource path="res://game/rooms/room11/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_location.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_item.gd" type="Script" id=7]
[ext_resource path="res://game/rooms/room11/r_door.tscn" type="PackedScene" id=8]
[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 ) ]
[sub_resource type="CircleShape2D" id=2]
radius = 53.6249
[node name="room11" type="Node2D"]
script = ExtResource( 6 )
__meta__ = {
"_edit_vertical_guides_": [ ]
}
global_id = "room11"
esc_script = "res://game/rooms/room11/esc/room11.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 = 92.0
margin_bottom = 21.0
custom_fonts/font = ExtResource( 3 )
text = "ROOM 11"
__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"]
pause_mode = 1
script = ExtResource( 7 )
global_id = "r11_l_exit"
esc_script = "res://game/rooms/room11/esc/left_exit.esc"
is_exit = true
tooltip_name = "Left exit"
default_action = "walk"
dialog_color = Color( 1, 1, 1, 1 )
animations = null
[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="ESCLocation" type="Position2D" parent="Hotspots/l_door"]
position = Vector2( 37.4521, 392.045 )
script = ExtResource( 5 )
[node name="r_door" parent="Hotspots" instance=ExtResource( 8 )]
global_id = "r11_r_exit"
esc_script = "res://game/rooms/room11/esc/right_exit.esc"
[node name="ESCLocation" type="Position2D" parent="Hotspots/r_door"]
position = Vector2( 1236.02, 366.281 )
script = ExtResource( 5 )
[node name="circleTK" type="Area2D" parent="Hotspots"]
pause_mode = 1
position = Vector2( -422.136, 0 )
script = ExtResource( 7 )
global_id = "r11_circle_tk"
esc_script = "res://game/rooms/room11/esc/mysterious_circle_tk.esc"
tooltip_name = "Mysterious circle"
dialog_color = Color( 1, 1, 1, 1 )
animations = null
[node name="Polygon2D" type="Polygon2D" parent="Hotspots/circleTK"]
position = Vector2( 50.9425, -76.4136 )
polygon = PoolVector2Array( 555.881, 185.538, 519.921, 215.504, 525.914, 257.456, 552.884, 282.928, 587.345, 284.426, 623.305, 260.453, 623.305, 219.999, 594.837, 187.036 )
[node name="ESCLocation" type="Position2D" parent="Hotspots/circleTK"]
position = Vector2( 624.794, 379.072 )
script = ExtResource( 5 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hotspots/circleTK"]
position = Vector2( 623.668, 159.806 )
shape = SubResource( 2 )
[node name="Label" type="Label" parent="Hotspots/circleTK"]
margin_left = 700.416
margin_top = 152.655
margin_right = 756.416
margin_bottom = 166.655
text = "FLAG: TK"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="circleNoTT" type="Area2D" parent="Hotspots"]
pause_mode = 1
position = Vector2( -151.623, 0 )
script = ExtResource( 7 )
global_id = "r11_circle_nott"
esc_script = "res://game/rooms/room11/esc/mysterious_circle_nott.esc"
tooltip_name = "Mysterious circle"
dialog_color = Color( 1, 1, 1, 1 )
animations = null
[node name="Polygon2D" type="Polygon2D" parent="Hotspots/circleNoTT"]
position = Vector2( 50.9425, -76.4136 )
polygon = PoolVector2Array( 555.881, 185.538, 519.921, 215.504, 525.914, 257.456, 552.884, 282.928, 587.345, 284.426, 623.305, 260.453, 623.305, 219.999, 594.837, 187.036 )
[node name="ESCLocation" type="Position2D" parent="Hotspots/circleNoTT"]
position = Vector2( 624.794, 379.072 )
script = ExtResource( 5 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hotspots/circleNoTT"]
position = Vector2( 623.668, 159.806 )
shape = SubResource( 2 )
[node name="Label" type="Label" parent="Hotspots/circleNoTT"]
margin_left = 691.437
margin_top = 152.655
margin_right = 773.437
margin_bottom = 166.655
text = "FLAG: NO_TT"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="circleNoHUD" type="Area2D" parent="Hotspots"]
pause_mode = 1
position = Vector2( 118.891, 0 )
script = ExtResource( 7 )
global_id = "r11_circle_nohud"
esc_script = "res://game/rooms/room11/esc/mysterious_circle_nohud.esc"
tooltip_name = "Mysterious circle"
dialog_color = Color( 1, 1, 1, 1 )
animations = null
[node name="Polygon2D" type="Polygon2D" parent="Hotspots/circleNoHUD"]
position = Vector2( 50.9425, -76.4136 )
polygon = PoolVector2Array( 555.881, 185.538, 519.921, 215.504, 525.914, 257.456, 552.884, 282.928, 587.345, 284.426, 623.305, 260.453, 623.305, 219.999, 594.837, 187.036 )
[node name="ESCLocation" type="Position2D" parent="Hotspots/circleNoHUD"]
position = Vector2( 624.794, 379.072 )
script = ExtResource( 5 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hotspots/circleNoHUD"]
position = Vector2( 623.668, 159.806 )
shape = SubResource( 2 )
[node name="Label" type="Label" parent="Hotspots/circleNoHUD"]
margin_left = 691.437
margin_top = 152.655
margin_right = 773.437
margin_bottom = 166.655
text = "FLAG: NO_HUD"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="circleNoSave" type="Area2D" parent="Hotspots"]
pause_mode = 1
position = Vector2( 366.891, 0 )
script = ExtResource( 7 )
global_id = "r11_circle_nosave"
esc_script = "res://game/rooms/room11/esc/mysterious_circle_nosave.esc"
tooltip_name = "Mysterious circle"
dialog_color = Color( 1, 1, 1, 1 )
animations = null
[node name="Polygon2D" type="Polygon2D" parent="Hotspots/circleNoSave"]
position = Vector2( 50.9425, -76.4136 )
polygon = PoolVector2Array( 555.881, 185.538, 519.921, 215.504, 525.914, 257.456, 552.884, 282.928, 587.345, 284.426, 623.305, 260.453, 623.305, 219.999, 594.837, 187.036 )
[node name="ESCLocation" type="Position2D" parent="Hotspots/circleNoSave"]
position = Vector2( 624.794, 379.072 )
script = ExtResource( 5 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hotspots/circleNoSave"]
position = Vector2( 623.668, 159.806 )
shape = SubResource( 2 )
[node name="Label" type="Label" parent="Hotspots/circleNoSave"]
margin_left = 691.437
margin_top = 152.655
margin_right = 773.437
margin_bottom = 166.655
text = "FLAG: NO_SAVE"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="circleFadeIn" type="Area2D" parent="Hotspots"]
pause_mode = 1
position = Vector2( -11.1087, 107 )
script = ExtResource( 7 )
global_id = "r11_circle_fadein"
esc_script = "res://game/rooms/room11/esc/mysterious_circle_fadein.esc"
tooltip_name = "Mysterious circle"
dialog_color = Color( 1, 1, 1, 1 )
animations = null
[node name="Polygon2D" type="Polygon2D" parent="Hotspots/circleFadeIn"]
position = Vector2( 50.9425, -76.4136 )
polygon = PoolVector2Array( 555.881, 185.538, 519.921, 215.504, 525.914, 257.456, 552.884, 282.928, 587.345, 284.426, 623.305, 260.453, 623.305, 219.999, 594.837, 187.036 )
[node name="ESCLocation" type="Position2D" parent="Hotspots/circleFadeIn"]
position = Vector2( 624.794, 274.072 )
script = ExtResource( 5 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hotspots/circleFadeIn"]
position = Vector2( 623.668, 159.806 )
shape = SubResource( 2 )
[node name="Label" type="Label" parent="Hotspots/circleFadeIn"]
margin_left = 691.437
margin_top = 152.655
margin_right = 773.437
margin_bottom = 166.655
text = "FADE OUT -> FADE IN"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="player_start" type="Position2D" parent="."]
position = Vector2( 542.824, 468.193 )
script = ExtResource( 5 )
global_id = "player_start"
is_start_location = true

View File

@@ -0,0 +1,18 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_terrain.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

@@ -0,0 +1,30 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_background.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_": ""
}
[node name="r_door" type="Line2D" parent="."]
position = Vector2( 0, -267.828 )
points = PoolVector2Array( 1175.07, 620.086, 1171.24, 311.267, 1274.8, 356.87, 1278.31, 672.412, 1188.64, 624.843 )
__meta__ = {
"_editor_description_": ""
}

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/room11/room11.tscn"

View File

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

View File

@@ -0,0 +1,21 @@
:setup
> [eq ESC_LAST_SCENE room11]
teleport player r12_l_exit
# Set player look right
set_angle player 180
stop
> [eq ESC_LAST_SCENE room13]
teleport player r12_r_exit
# Set player look left
set_angle player 270
stop
> [!last_scene]
teleport player player_start
stop
:ready
transition fade_white in

View File

@@ -0,0 +1,25 @@
[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="r_door" type="Area2D"]
pause_mode = 1
script = ExtResource( 1 )
__meta__ = {
"_editor_description_": ""
}
global_id = "r1_r_exit"
esc_script = "res://game/rooms/room01/esc/right_exit.esc"
is_exit = true
tooltip_name = "Exit"
default_action = "walk"
dialog_color = Color( 1, 1, 1, 1 )
animations = null
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."]
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 )
script = ExtResource( 2 )

View File

@@ -0,0 +1,82 @@
[gd_scene load_steps=10 format=2]
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_terrain.gd" type="Script" id=1]
[ext_resource path="res://game/rooms/room12/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_location.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_item.gd" type="Script" id=7]
[ext_resource path="res://game/rooms/room12/r_door.tscn" type="PackedScene" id=8]
[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="room12" type="Node2D"]
script = ExtResource( 6 )
__meta__ = {
"_edit_vertical_guides_": [ ]
}
global_id = "room12"
esc_script = "res://game/rooms/room12/esc/room12.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 = 92.0
margin_bottom = 21.0
custom_fonts/font = ExtResource( 3 )
text = "ROOM 12
"
__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"]
pause_mode = 1
script = ExtResource( 7 )
global_id = "r12_l_exit"
esc_script = "res://game/rooms/room12/esc/left_exit.esc"
is_exit = true
tooltip_name = "Left exit"
default_action = "walk"
dialog_color = Color( 1, 1, 1, 1 )
animations = null
[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 )
script = ExtResource( 5 )
global_id = "r12_l_exit"
[node name="r_door" parent="Hotspots" instance=ExtResource( 8 )]
global_id = "r12_r_exit"
esc_script = "res://game/rooms/room12/esc/right_exit.esc"
[node name="ESCLocation" type="Position2D" parent="Hotspots/r_door"]
position = Vector2( 1231.78, 360.624 )
script = ExtResource( 5 )
[node name="player_start" type="Position2D" parent="."]
position = Vector2( 542.824, 468.193 )
script = ExtResource( 5 )
global_id = "player_start"
is_start_location = true

View File

@@ -0,0 +1,18 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_terrain.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

@@ -27,3 +27,12 @@ change_scene res://game/rooms/room01/room01.tscn
# 9/ Indy4 3 closets
#change_scene res://game/rooms/room09/room09.tscn
# 10/
#change_scene res://game/rooms/room10/room10.tscn
# 11/ Event flags tests
#change_scene res://game/rooms/room11/room11.tscn
# 12/ Event flags tests 2
#change_scene res://game/rooms/room12/room12.tscn

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

View File

@@ -1,34 +0,0 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/guybrush.jpeg-2fc39d8d3de855fdd1e6fd25540a16ab.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://game/ui/commons/dialogs/insets/guybrush.jpeg"
dest_files=[ "res://.import/guybrush.jpeg-2fc39d8d3de855fdd1e6fd25540a16ab.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

View File

@@ -2,7 +2,7 @@
[ext_resource path="res://game/ui/commons/main_menu/main_menu.gd" type="Script" id=1]
[ext_resource path="res://game/ui/commons/main_menu/main.tscn" type="PackedScene" id=2]
[ext_resource path="res://addons/escoria-core/logo/escoria-logo-small.png" type="Texture" id=3]
[ext_resource path="res://addons/escoria-core/design/escoria-logo-small.png" type="Texture" id=3]
[ext_resource path="res://game/ui/commons/options/options.tscn" type="PackedScene" id=4]
[ext_resource path="res://game/ui/commons/load/load_game.tscn" type="PackedScene" id=5]
@@ -28,9 +28,9 @@ anchor_bottom = 1.0
[node name="main" type="VBoxContainer" parent="Panel/CenterContainer"]
margin_left = 332.0
margin_top = 150.0
margin_top = 151.0
margin_right = 948.0
margin_bottom = 749.0
margin_bottom = 748.0
custom_constants/separation = 100
[node name="TextureRect" type="TextureRect" parent="Panel/CenterContainer/main"]
@@ -49,19 +49,26 @@ anchor_bottom = 0.0
margin_left = 0.0
margin_top = 336.0
margin_right = 616.0
margin_bottom = 599.0
margin_bottom = 597.0
[node name="new_game" parent="Panel/CenterContainer/main/buttons" index="0"]
margin_right = 616.0
margin_bottom = 150.0
[node name="load_game" parent="Panel/CenterContainer/main/buttons" index="1"]
margin_top = 160.0
margin_right = 616.0
margin_bottom = 187.0
[node name="options" parent="Panel/CenterContainer/main/buttons" index="2"]
margin_top = 197.0
margin_right = 616.0
margin_bottom = 224.0
[node name="quit" parent="Panel/CenterContainer/main/buttons" index="3"]
margin_top = 234.0
margin_right = 616.0
margin_bottom = 261.0
[node name="options" parent="Panel" instance=ExtResource( 4 )]
visible = false

View File

@@ -33,3 +33,7 @@ func _on_save_game_back_button_pressed():
func _on_load_game_back_button_pressed():
$Panel/CenterContainer/VBoxContainer.show()
$load_game.hide()
func set_save_enabled(p_enabled: bool):
$Panel/CenterContainer/VBoxContainer/menuitems/save_game.disabled = !p_enabled

View File

@@ -2,7 +2,7 @@
[ext_resource path="res://game/ui/commons/pause_menu/pause_menu.gd" type="Script" id=1]
[ext_resource path="res://game/ui/commons/fonts/caslonantique.tres" type="DynamicFont" id=2]
[ext_resource path="res://addons/escoria-core/logo/escoria-logo-small.png" type="Texture" id=3]
[ext_resource path="res://addons/escoria-core/design/escoria-logo-small.png" type="Texture" id=3]
[ext_resource path="res://game/ui/commons/save/save_game.tscn" type="PackedScene" id=4]
[ext_resource path="res://game/ui/commons/load/load_game.tscn" type="PackedScene" id=5]

View File

@@ -465,6 +465,11 @@ _global_script_classes=[ {
"path": "res://addons/escoria-core/game/core-scripts/esc/commands/teleport_pos.gd"
}, {
"base": "ESCBaseCommand",
"class": "TransitionCommand",
"language": "GDScript",
"path": "res://addons/escoria-core/game/core-scripts/esc/commands/transition.gd"
}, {
"base": "ESCBaseCommand",
"class": "TurnToCommand",
"language": "GDScript",
"path": "res://addons/escoria-core/game/core-scripts/esc/commands/turn_to.gd"
@@ -586,6 +591,7 @@ _global_script_class_icons={
"StopCommand": "",
"TeleportCommand": "",
"TeleportPosCommand": "",
"TransitionCommand": "",
"TurnToCommand": "",
"WaitCommand": "",
"WalkBlockCommand": "",
@@ -598,7 +604,7 @@ _global_script_class_icons={
config/name="Escoria"
run/main_scene="res://addons/escoria-core/game/main_scene.tscn"
boot_splash/image="res://addons/escoria-core/logo/escoria-logo-small.png"
boot_splash/image="res://addons/escoria-core/design/escoria-logo-small.png"
boot_splash/fullsize=false
boot_splash/use_filter=false
boot_splash/bg_color=Color( 0.960784, 0.384314, 0, 1 )