Fixed bug where walk action initiated by ESC would never call finished().

Also removed call to inexisting function in ESCInventoryContainer.
This commit is contained in:
Julian Murgia
2021-01-28 13:32:14 +01:00
parent 14e85edba7
commit e6f4af74a8
51 changed files with 1515 additions and 35 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
bin/*

View File

@@ -0,0 +1,3 @@
source_md5="39c4090b34cc00d1b8812a1b47cf1a0d"
dest_md5="6cad66eb70afdfebb2d4ca413d2fa6bd"

View File

@@ -0,0 +1,3 @@
source_md5="0167658bc4406f0d0fe437e0197c415a"
dest_md5="64b0613b3173e1e1c96dd18b6569e62d"

View File

@@ -0,0 +1,3 @@
source_md5="c6032bc6d50e5de813e639d521268117"
dest_md5="11e1a7584a1c7f6f418a50a6f97a0008"

View File

@@ -0,0 +1,3 @@
source_md5="7e41bf3051b18e392a4bb6c0cc45cd7c"
dest_md5="92eb858faaa1840609e0a1d10f0a2ab1"

View File

@@ -0,0 +1,3 @@
source_md5="8cfb8b39be6d0f38075cde9ffa33e10c"
dest_md5="9aa48800dc0395de3e5cf0ef1688ad8d"

Binary file not shown.

View File

@@ -0,0 +1,3 @@
source_md5="eca000256902891d98ea725d2ac0f529"
dest_md5="8f3874a4c89493ae930439d7cb67acb7"

View File

@@ -90,7 +90,7 @@ func _process(time):
current_animation = animation_to_play
escoria.report_warnings("movable.gd:_process()",
["Character " + parent.global_id + " has no animation " + animation_to_play,
"Bypassing missing animation and proceed movement."])
"Bypassing missing animation and proceed movement."], true)
pose_scale = parent.animations.directions[last_dir][1]
@@ -132,7 +132,6 @@ func walk_to(pos : Vector2, p_walk_context = null):
walk_context["fast"] = p_walk_context["fast"]
return true
else:
# return false
pass
if parent.task == parent.PLAYER_TASKS.NONE:
parent.task = parent.PLAYER_TASKS.WALK
@@ -197,6 +196,7 @@ func walk_stop(pos):
last_dir = orientation
parent.animation_sprite.play(parent.animations.idles[orientation][0])
pose_scale = parent.animations.idles[orientation][1]
else:
parent.animation_sprite.play(parent.animations.idles[last_dir][0])
pose_scale = parent.animations.idles[last_dir][1]
@@ -204,10 +204,11 @@ func walk_stop(pos):
if walk_context != null:
escoria.esc_level_runner.finished(walk_context)
# escoria.esc_level_runner.finished()
escoria.esc_level_runner.finished()
# walk_context = null
yield(parent.animation_sprite, "animation_finished")
printt(parent.global_id + " arrived at ", walk_context)
parent.emit_signal("arrived", walk_context)

View File

@@ -26,6 +26,10 @@ enum GAME_STATE {
}
onready var current_state = GAME_STATE.DEFAULT
# Logging
onready var is_reported : bool = false
##################################################################################
func _ready():
pass
@@ -46,7 +50,8 @@ func change_scene_path(scene_path):
func set_main_menu(scene):
main_menu_instance = scene
func report_warnings(p_path : String, warnings : Array) -> void:
func report_warnings(p_path : String, warnings : Array, report_once = false) -> void:
if !is_reported:
var text = "Warnings in file "+p_path+"\n"
for w in warnings:
if w is Array:
@@ -55,6 +60,9 @@ func report_warnings(p_path : String, warnings : Array) -> void:
text += w+"\n"
printerr("warning is: ", text)
if report_once:
is_reported = true
func report_errors(p_path : String, errors : Array) -> void:
var text = "Errors in file "+p_path+"\n"

BIN
bin/html5/favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/favicon.png-6bf42f281f237811e41d92b65e7fc58a.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://bin/html5/favicon.png"
dest_files=[ "res://.import/favicon.png-6bf42f281f237811e41d92b65e7fc58a.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

@@ -0,0 +1,186 @@
/*************************************************************************/
/* audio.worklet.js */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
class RingBuffer {
constructor(p_buffer, p_state) {
this.buffer = p_buffer;
this.avail = p_state;
this.rpos = 0;
this.wpos = 0;
}
data_left() {
return Atomics.load(this.avail, 0);
}
space_left() {
return this.buffer.length - this.data_left();
}
read(output) {
const size = this.buffer.length;
let from = 0;
let to_write = output.length;
if (this.rpos + to_write > size) {
const high = size - this.rpos;
output.set(this.buffer.subarray(this.rpos, size));
from = high;
to_write -= high;
this.rpos = 0;
}
output.set(this.buffer.subarray(this.rpos, this.rpos + to_write), from);
this.rpos += to_write;
Atomics.add(this.avail, 0, -output.length);
Atomics.notify(this.avail, 0);
}
write(p_buffer) {
const to_write = p_buffer.length;
const mw = this.buffer.length - this.wpos;
if (mw >= to_write) {
this.buffer.set(p_buffer, this.wpos);
} else {
const high = p_buffer.subarray(0, to_write - mw);
const low = p_buffer.subarray(to_write - mw);
this.buffer.set(high, this.wpos);
this.buffer.set(low);
}
let diff = to_write;
if (this.wpos + diff >= this.buffer.length) {
diff -= this.buffer.length;
}
this.wpos += diff;
Atomics.add(this.avail, 0, to_write);
Atomics.notify(this.avail, 0);
}
}
class GodotProcessor extends AudioWorkletProcessor {
constructor() {
super();
this.running = true;
this.lock = null;
this.notifier = null;
this.output = null;
this.output_buffer = new Float32Array();
this.input = null;
this.input_buffer = new Float32Array();
this.port.onmessage = (event) => {
const cmd = event.data['cmd'];
const data = event.data['data'];
this.parse_message(cmd, data);
};
}
process_notify() {
Atomics.add(this.notifier, 0, 1);
Atomics.notify(this.notifier, 0);
}
parse_message(p_cmd, p_data) {
if (p_cmd === 'start' && p_data) {
const state = p_data[0];
let idx = 0;
this.lock = state.subarray(idx, ++idx);
this.notifier = state.subarray(idx, ++idx);
const avail_in = state.subarray(idx, ++idx);
const avail_out = state.subarray(idx, ++idx);
this.input = new RingBuffer(p_data[1], avail_in);
this.output = new RingBuffer(p_data[2], avail_out);
} else if (p_cmd === 'stop') {
this.runing = false;
this.output = null;
this.input = null;
}
}
static array_has_data(arr) {
return arr.length && arr[0].length && arr[0][0].length;
}
process(inputs, outputs, parameters) {
if (!this.running) {
return false; // Stop processing.
}
if (this.output === null) {
return true; // Not ready yet, keep processing.
}
const process_input = GodotProcessor.array_has_data(inputs);
if (process_input) {
const input = inputs[0];
const chunk = input[0].length * input.length;
if (this.input_buffer.length !== chunk) {
this.input_buffer = new Float32Array(chunk);
}
if (this.input.space_left() >= chunk) {
GodotProcessor.write_input(this.input_buffer, input);
this.input.write(this.input_buffer);
} else {
this.port.postMessage('Input buffer is full! Skipping input frame.');
}
}
const process_output = GodotProcessor.array_has_data(outputs);
if (process_output) {
const output = outputs[0];
const chunk = output[0].length * output.length;
if (this.output_buffer.length !== chunk) {
this.output_buffer = new Float32Array(chunk);
}
if (this.output.data_left() >= chunk) {
this.output.read(this.output_buffer);
GodotProcessor.write_output(output, this.output_buffer);
} else {
this.port.postMessage('Output buffer has not enough frames! Skipping output frame.');
}
}
this.process_notify();
return true;
}
static write_output(dest, source) {
const channels = dest.length;
for (let ch = 0; ch < channels; ch++) {
for (let sample = 0; sample < dest[ch].length; sample++) {
dest[ch][sample] = source[sample * channels + ch];
}
}
}
static write_input(dest, source) {
const channels = source.length;
for (let ch = 0; ch < channels; ch++) {
for (let sample = 0; sample < source[ch].length; sample++) {
dest[sample * channels + ch] = source[ch][sample];
}
}
}
}
registerProcessor('godot-processor', GodotProcessor);

281
bin/html5/index.html Normal file
View File

@@ -0,0 +1,281 @@
<!DOCTYPE html>
<html xmlns='http://www.w3.org/1999/xhtml' lang='' xml:lang=''>
<head>
<meta charset='utf-8' />
<meta name='viewport' content='width=device-width, user-scalable=no' />
<link id='-gd-engine-icon' rel='icon' type='image/png' href='favicon.png' />
<title>Escoria-reloaded</title>
<style type='text/css'>
body {
touch-action: none;
margin: 0;
border: 0 none;
padding: 0;
text-align: center;
background-color: black;
}
#canvas {
display: block;
margin: 0;
color: white;
}
#canvas:focus {
outline: none;
}
.godot {
font-family: 'Noto Sans', 'Droid Sans', Arial, sans-serif;
color: #e0e0e0;
background-color: #3b3943;
background-image: linear-gradient(to bottom, #403e48, #35333c);
border: 1px solid #45434e;
box-shadow: 0 0 1px 1px #2f2d35;
}
/* Status display
* ============== */
#status {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
display: flex;
justify-content: center;
align-items: center;
/* don't consume click events - make children visible explicitly */
visibility: hidden;
}
#status-progress {
width: 366px;
height: 7px;
background-color: #38363A;
border: 1px solid #444246;
padding: 1px;
box-shadow: 0 0 2px 1px #1B1C22;
border-radius: 2px;
visibility: visible;
}
@media only screen and (orientation:portrait) {
#status-progress {
width: 61.8%;
}
}
#status-progress-inner {
height: 100%;
width: 0;
box-sizing: border-box;
transition: width 0.5s linear;
background-color: #202020;
border: 1px solid #222223;
box-shadow: 0 0 1px 1px #27282E;
border-radius: 3px;
}
#status-indeterminate {
visibility: visible;
position: relative;
}
#status-indeterminate > div {
width: 4.5px;
height: 0;
border-style: solid;
border-width: 9px 3px 0 3px;
border-color: #2b2b2b transparent transparent transparent;
transform-origin: center 21px;
position: absolute;
}
#status-indeterminate > div:nth-child(1) { transform: rotate( 22.5deg); }
#status-indeterminate > div:nth-child(2) { transform: rotate( 67.5deg); }
#status-indeterminate > div:nth-child(3) { transform: rotate(112.5deg); }
#status-indeterminate > div:nth-child(4) { transform: rotate(157.5deg); }
#status-indeterminate > div:nth-child(5) { transform: rotate(202.5deg); }
#status-indeterminate > div:nth-child(6) { transform: rotate(247.5deg); }
#status-indeterminate > div:nth-child(7) { transform: rotate(292.5deg); }
#status-indeterminate > div:nth-child(8) { transform: rotate(337.5deg); }
#status-notice {
margin: 0 100px;
line-height: 1.3;
visibility: visible;
padding: 4px 6px;
visibility: visible;
}
</style>
</head>
<body>
<canvas id='canvas'>
HTML5 canvas appears to be unsupported in the current browser.<br />
Please try updating or use a different browser.
</canvas>
<div id='status'>
<div id='status-progress' style='display: none;' oncontextmenu='event.preventDefault();'><div id ='status-progress-inner'></div></div>
<div id='status-indeterminate' style='display: none;' oncontextmenu='event.preventDefault();'>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<div id='status-notice' class='godot' style='display: none;'></div>
</div>
<script type='text/javascript' src='index.js'></script>
<script type='text/javascript'>//<![CDATA[
var engine = new Engine;
var setStatusMode;
var setStatusNotice;
(function() {
const EXECUTABLE_NAME = 'index';
const MAIN_PACK = 'index.pck';
const GDNATIVE_LIBS = [];
const INDETERMINATE_STATUS_STEP_MS = 100;
const FULL_WINDOW = true;
var canvas = document.getElementById('canvas');
var statusProgress = document.getElementById('status-progress');
var statusProgressInner = document.getElementById('status-progress-inner');
var statusIndeterminate = document.getElementById('status-indeterminate');
var statusNotice = document.getElementById('status-notice');
var initializing = true;
var statusMode = 'hidden';
var lastWidth = 0;
var lastHeight = 0;
var lastScale = 0;
var animationCallbacks = [];
function animate(time) {
animationCallbacks.forEach(callback => callback(time));
requestAnimationFrame(animate);
}
requestAnimationFrame(animate);
function adjustCanvasDimensions() {
const scale = window.devicePixelRatio || 1;
if (lastWidth != window.innerWidth || lastHeight != window.innerHeight || lastScale != scale) {
lastScale = scale;
lastWidth = window.innerWidth;
lastHeight = window.innerHeight;
canvas.width = Math.floor(lastWidth * scale);
canvas.height = Math.floor(lastHeight * scale);
canvas.style.width = lastWidth + "px";
canvas.style.height = lastHeight + "px";
}
}
if (FULL_WINDOW) {
animationCallbacks.push(adjustCanvasDimensions);
adjustCanvasDimensions();
} else {
engine.setCanvasResizedOnStart(true);
}
setStatusMode = function setStatusMode(mode) {
if (statusMode === mode || !initializing)
return;
[statusProgress, statusIndeterminate, statusNotice].forEach(elem => {
elem.style.display = 'none';
});
animationCallbacks = animationCallbacks.filter(function(value) {
return (value != animateStatusIndeterminate);
});
switch (mode) {
case 'progress':
statusProgress.style.display = 'block';
break;
case 'indeterminate':
statusIndeterminate.style.display = 'block';
animationCallbacks.push(animateStatusIndeterminate);
break;
case 'notice':
statusNotice.style.display = 'block';
break;
case 'hidden':
break;
default:
throw new Error('Invalid status mode');
}
statusMode = mode;
}
function animateStatusIndeterminate(ms) {
var i = Math.floor(ms / INDETERMINATE_STATUS_STEP_MS % 8);
if (statusIndeterminate.children[i].style.borderTopColor == '') {
Array.prototype.slice.call(statusIndeterminate.children).forEach(child => {
child.style.borderTopColor = '';
});
statusIndeterminate.children[i].style.borderTopColor = '#dfdfdf';
}
}
setStatusNotice = function setStatusNotice(text) {
while (statusNotice.lastChild) {
statusNotice.removeChild(statusNotice.lastChild);
}
var lines = text.split('\n');
lines.forEach((line) => {
statusNotice.appendChild(document.createTextNode(line));
statusNotice.appendChild(document.createElement('br'));
});
};
engine.setProgressFunc((current, total) => {
if (total > 0) {
statusProgressInner.style.width = current/total * 100 + '%';
setStatusMode('progress');
if (current === total) {
// wait for progress bar animation
setTimeout(() => {
setStatusMode('indeterminate');
}, 500);
}
} else {
setStatusMode('indeterminate');
}
});
function displayFailureNotice(err) {
var msg = err.message || err;
console.error(msg);
setStatusNotice(msg);
setStatusMode('notice');
initializing = false;
};
if (!Engine.isWebGLAvailable()) {
displayFailureNotice('WebGL not available');
} else {
setStatusMode('indeterminate');
engine.setCanvas(canvas);
engine.setGDNativeLibraries(GDNATIVE_LIBS);
engine.startGame(EXECUTABLE_NAME, MAIN_PACK).then(() => {
setStatusMode('hidden');
initializing = false;
}, displayFailureNotice);
}
})();
//]]></script>
</body>
</html>

501
bin/html5/index.js Normal file

File diff suppressed because one or more lines are too long

BIN
bin/html5/index.pck Normal file

Binary file not shown.

BIN
bin/html5/index.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/index.png-7663b4c35f4e22caef50fe5165188bb3.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://bin/html5/index.png"
dest_files=[ "res://.import/index.png-7663b4c35f4e22caef50fe5165188bb3.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

BIN
bin/html5/index.wasm Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -2,7 +2,7 @@
name="Windows Desktop x86"
platform="Windows Desktop"
runnable=true
runnable=false
custom_features=""
export_filter="all_resources"
include_filter="*.esc"
@@ -43,7 +43,7 @@ application/trademarks=""
name="Windows Desktop x64"
platform="Windows Desktop"
runnable=false
runnable=true
custom_features=""
export_filter="all_resources"
include_filter="*.esc"
@@ -104,3 +104,27 @@ texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false
texture_format/no_bptc_fallbacks=true
[preset.3]
name="HTML5"
platform="HTML5"
runnable=true
custom_features=""
export_filter="all_resources"
include_filter="*.esc"
exclude_filter=""
export_path="bin/html5/index.html"
script_export_mode=1
script_encryption_key=""
[preset.3.options]
custom_template/debug=""
custom_template/release=""
variant/export_type=0
vram_texture_compression/for_desktop=true
vram_texture_compression/for_mobile=false
html/custom_html_shell=""
html/head_include=""
html/full_window_size=true

View File

@@ -0,0 +1,19 @@
[gd_scene load_steps=3 format=2]
[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, 29.8513 )
[node name="button_right" type="Area2D"]
script = ExtResource( 1 )
tooltip_name = "Button"
default_action = "use"
dialog_color = Color( 1, 1, 1, 1 )
interact_positions = {
"default": Vector2( 971.212, 150.721 )
}
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2( 971.212, 150.721 )
shape = SubResource( 1 )

View File

@@ -84,16 +84,7 @@ position = Vector2( 52.1462, 384.691 )
global_id = "r2_button_right"
esc_script = "res://game/rooms/room2/esc/button.esc"
interact_positions = {
"default": Vector2( 971.212, 150.721 )
}
[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 )
"default": Vector2( 337.299, 370.025 )
}
[node name="Position2D" type="Position2D" parent="Hotspots/button_right"]
@@ -102,8 +93,16 @@ __meta__ = {
"_editor_description_": ""
}
[node name="Position2D2" type="Position2D" parent="Hotspots/button_right"]
position = Vector2( 337.299, 370.025 )
[node name="button_left" parent="Hotspots" instance=ExtResource( 5 )]
position = Vector2( -625.523, 0 )
global_id = "r2_button"
esc_script = "res://game/rooms/room2/esc/button.esc"
interact_positions = {
"default": Vector2( 345.689, 150.721 )
}
[node name="Position2D" type="Position2D" parent="Hotspots/button_left"]
position = Vector2( 962.822, 370.025 )
__meta__ = {
"_editor_description_": ""
}

View File

@@ -18,4 +18,4 @@
#set_active r5_pen false
#set_global i/r5_empty_sheet true
#set_active r5_empty_sheet false
inventory_add r5_filled_sheet
#inventory_add r5_filled_sheet

View File

@@ -1,2 +1,2 @@
:exit_scene
#change_scene "res://game/rooms/room9/room9.tscn"
change_scene "res://game/rooms/room9/room9.tscn"

View File

@@ -0,0 +1,27 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://addons/escoria-core/game/core-scripts/escbackground.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, 1271.64, 671.735, 1188.64, 624.843 )

View File

@@ -0,0 +1,12 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://addons/escoria-core/game/core-scripts/escitem.gd" type="Script" id=1]
[node name="magical_closet" type="Area2D"]
script = ExtResource( 1 )
dialog_color = Color( 1, 1, 1, 1 )
interact_positions = {
"default": null
}
[node name="Line2D" type="Line2D" parent="."]

View File

@@ -0,0 +1,5 @@
# Magical closet: the object is always in the LAST opened closet
:open

View File

@@ -0,0 +1,2 @@
:exit_scene
change_scene "res://game/rooms/room7/room7.tscn"

9
game/rooms/room9/esc/room9.esc Executable file
View File

@@ -0,0 +1,9 @@
# :SETUP is called EVERY TIME the room is loaded
# :READY is called only the FIRST TIME the room is loaded
:setup
:ready

View File

@@ -0,0 +1,85 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://addons/escoria-core/game/core-scripts/escitem.gd" type="Script" id=1]
[sub_resource type="Animation" id=1]
resource_name = "state_round"
tracks/0/type = "value"
tracks/0/path = NodePath("square: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("round: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 ]
}
[sub_resource type="Animation" id=2]
resource_name = "state_square"
tracks/0/type = "value"
tracks/0/path = NodePath("square: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("round: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 ]
}
[node name="item_wall" type="Area2D"]
script = ExtResource( 1 )
dialog_color = Color( 1, 1, 1, 1 )
interact_positions = {
"default": Vector2( 0, 0 )
}
[node name="square" type="Line2D" parent="."]
points = PoolVector2Array( 531, 527.828, 532, 483.828, 532.586, 445.745, 533.262, 401.771, 534, 353.828, 575.992, 355.093, 617.954, 356.357, 660.945, 357.652, 700, 358.828, 700.786, 402.832, 701.536, 444.836, 702.286, 486.841, 703, 526.828, 659.007, 526.574, 619.997, 526.348, 574.998, 526.088, 530, 525.828 )
__meta__ = {
"_editor_description_": ""
}
[node name="round" type="Line2D" parent="."]
visible = false
points = PoolVector2Array( 559.845, 508.706, 537.622, 482.513, 532.586, 445.745, 537.622, 414.255, 551.908, 384.095, 578.101, 366.633, 617.954, 356.357, 659.058, 363.458, 677.313, 375.364, 692.393, 399.175, 701.918, 441.241, 694.774, 484.101, 677.313, 504.737, 652.708, 518.23, 622.548, 526.167, 586.038, 518.23, 558.258, 506.324 )
__meta__ = {
"_editor_description_": ""
}
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."]
position = Vector2( 0, 265.2 )
polygon = PoolVector2Array( 528, 85, 529, 264, 708, 263, 706, 85 )
[node name="animation" type="AnimationPlayer" parent="."]
anims/state_round = SubResource( 1 )
anims/state_square = SubResource( 2 )

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/empty_sheet.png-76792812151af35ec4a677d2674810fc.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://game/rooms/room9/items/empty_sheet.png"
dest_files=[ "res://.import/empty_sheet.png-76792812151af35ec4a677d2674810fc.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/filled_sheet.png-b2986fedd542821915ec877a570a0934.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://game/rooms/room9/items/filled_sheet.png"
dest_files=[ "res://.import/filled_sheet.png-b2986fedd542821915ec877a570a0934.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 918 B

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/pen.png-185eba49da7d77d331c5119550be859c.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://game/rooms/room9/items/pen.png"
dest_files=[ "res://.import/pen.png-185eba49da7d77d331c5119550be859c.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 857 B

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/wrench.png-cd78241d27aa0dc800a83edce9459724.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://game/rooms/room9/items/wrench.png"
dest_files=[ "res://.import/wrench.png-cd78241d27aa0dc800a83edce9459724.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

@@ -0,0 +1,83 @@
[gd_scene load_steps=8 format=2]
[ext_resource path="res://addons/escoria-core/game/core-scripts/escterrain.gd" type="Script" id=1]
[ext_resource path="res://game/rooms/room9/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/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="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="room9" type="Node2D"]
script = ExtResource( 6 )
__meta__ = {
"_edit_vertical_guides_": [ ]
}
global_id = "room9"
esc_script = "res://game/rooms/room9/esc/room9.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 = 62.0
margin_bottom = 16.0
custom_fonts/font = ExtResource( 3 )
text = "ROOM 9"
__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"]
script = ExtResource( 7 )
global_id = "r9_l_exit"
esc_script = "res://game/rooms/room9/esc/left_exit.esc"
is_exit = true
tooltip_name = "Left exit"
dialog_color = Color( 1, 1, 1, 1 )
interact_positions = {
"default": Vector2( 37.4521, 392.045 )
}
[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 )
[node name="r_door" type="Area2D" parent="Hotspots"]
position = Vector2( -1, 0 )
script = ExtResource( 7 )
global_id = "r9_r_exit"
is_exit = true
tooltip_name = "Right exit"
dialog_color = Color( 1, 1, 1, 1 )
interact_positions = {
"default": Vector2( 1224.47, 353.99 )
}
[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 )
[node name="player_start" type="Position2D" parent="."]
position = Vector2( 76.7617, 437.649 )

View File

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

@@ -1,7 +1,7 @@
:start
# 1/ Simple scene
#change_scene res://game/rooms/room1/room1.tscn
change_scene res://game/rooms/room1/room1.tscn
# 2/ Button bridge
#change_scene res://game/rooms/room2/room2.tscn
@@ -16,7 +16,7 @@
#change_scene res://game/rooms/room5/room5.tscn
# 6/ character room
change_scene res://game/rooms/room6/room6.tscn
#change_scene res://game/rooms/room6/room6.tscn
# 7/ long room with camera shift to object 2 if look on object 1
# and stairs with camera shift too
@@ -24,3 +24,6 @@ change_scene res://game/rooms/room6/room6.tscn
# 8/ puzzle in superposed scene
#change_scene res://game/rooms/room8/room8.tscn
# 9/ Indy4 3 closets
#change_scene res://game/rooms/room9/room9.tscn

View File

@@ -37,6 +37,3 @@ func remove_item(inventory_item : ESCInventoryItem):
remove_child(node_to_remove)
node_to_remove.queue_free()
func _on_gui_input(event : InputEvent, inventory_item : ESCInventoryItem):
if event is InputEventMouseButton and event.is_pressed():
inventory_item._on_inventory_item_pressed()

View File

@@ -35,6 +35,3 @@ func remove_item(inventory_item : ESCInventoryItem):
remove_child(node_to_remove)
node_to_remove.queue_free()
#func _on_gui_input(event : InputEvent, inventory_item : ESCInventoryItem):
# if event is InputEventMouseButton and event.is_pressed():
# inventory_item._on_inventory_item_pressed()