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:
1 parent
14e85edba7
commit
e6f4af74a8
51 files changed
+1508
-28
No files matched your search
@@ -0,0 +1 @@
|
||||
bin/*
|
||||
@@ -0,0 +1,3 @@
|
||||
source_md5="39c4090b34cc00d1b8812a1b47cf1a0d"
|
||||
dest_md5="6cad66eb70afdfebb2d4ca413d2fa6bd"
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
source_md5="0167658bc4406f0d0fe437e0197c415a"
|
||||
dest_md5="64b0613b3173e1e1c96dd18b6569e62d"
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
source_md5="c6032bc6d50e5de813e639d521268117"
|
||||
dest_md5="11e1a7584a1c7f6f418a50a6f97a0008"
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
source_md5="7e41bf3051b18e392a4bb6c0cc45cd7c"
|
||||
dest_md5="92eb858faaa1840609e0a1d10f0a2ab1"
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
source_md5="8cfb8b39be6d0f38075cde9ffa33e10c"
|
||||
dest_md5="9aa48800dc0395de3e5cf0ef1688ad8d"
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
source_md5="eca000256902891d98ea725d2ac0f529"
|
||||
dest_md5="8f3874a4c89493ae930439d7cb67acb7"
|
||||
|
||||
Binary file not shown.
@@ -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)
|
||||
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 3.4 KiB |
@@ -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
|
||||
@@ -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);
|
||||
@@ -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>
|
||||
|
||||
@@ -0,0 +1,501 @@
|
||||
|
||||
var Godot = (function() {
|
||||
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
|
||||
|
||||
return (
|
||||
function(Godot) {
|
||||
Godot = Godot || {};
|
||||
|
||||
var Module=typeof Godot!=="undefined"?Godot:{};var readyPromiseResolve,readyPromiseReject;Module["ready"]=new Promise(function(resolve,reject){readyPromiseResolve=resolve;readyPromiseReject=reject});var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptDir){scriptDirectory=_scriptDir}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}{read_=function shell_read(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function readBinary(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function readAsync(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function xhr_onload(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var tempRet0=0;var setTempRet0=function(value){tempRet0=value};var getTempRet0=function(){return tempRet0};var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime;if(Module["noExitRuntime"])noExitRuntime=Module["noExitRuntime"];if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}function setValue(ptr,value,type,noSafe){type=type||"i8";if(type.charAt(type.length-1)==="*")type="i32";switch(type){case"i1":HEAP8[ptr>>0]=value;break;case"i8":HEAP8[ptr>>0]=value;break;case"i16":HEAP16[ptr>>1]=value;break;case"i32":HEAP32[ptr>>2]=value;break;case"i64":tempI64=[value>>>0,(tempDouble=value,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[ptr>>2]=tempI64[0],HEAP32[ptr+4>>2]=tempI64[1];break;case"float":HEAPF32[ptr>>2]=value;break;case"double":HEAPF64[ptr>>3]=value;break;default:abort("invalid type for setValue: "+type)}}function getValue(ptr,type,noSafe){type=type||"i8";if(type.charAt(type.length-1)==="*")type="i32";switch(type){case"i1":return HEAP8[ptr>>0];case"i8":return HEAP8[ptr>>0];case"i16":return HEAP16[ptr>>1];case"i32":return HEAP32[ptr>>2];case"i64":return HEAP32[ptr>>2];case"float":return HEAPF32[ptr>>2];case"double":return HEAPF64[ptr>>3];default:abort("invalid type for getValue: "+type)}return null}var wasmMemory;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}var UTF8Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf8"):undefined;function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var endPtr=idx;while(heap[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&heap.subarray&&UTF8Decoder){return UTF8Decoder.decode(heap.subarray(idx,endPtr))}else{var str="";while(idx<endPtr){var u0=heap[idx++];if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,5Line truncated
|
||||
|
||||
|
||||
return Godot.ready
|
||||
}
|
||||
);
|
||||
})();
|
||||
if (typeof exports === 'object' && typeof module === 'object')
|
||||
module.exports = Godot;
|
||||
else if (typeof define === 'function' && define['amd'])
|
||||
define([], function() { return Godot; });
|
||||
else if (typeof exports === 'object')
|
||||
exports["Godot"] = Godot;
|
||||
|
||||
const Preloader = /** @constructor */ function () { // eslint-disable-line no-unused-vars
|
||||
const loadXHR = function (resolve, reject, file, tracker, attempts) {
|
||||
const xhr = new XMLHttpRequest();
|
||||
tracker[file] = {
|
||||
total: 0,
|
||||
loaded: 0,
|
||||
final: false,
|
||||
};
|
||||
xhr.onerror = function () {
|
||||
if (attempts <= 1) {
|
||||
reject(new Error(`Failed loading file '${file}'`));
|
||||
} else {
|
||||
setTimeout(function () {
|
||||
loadXHR(resolve, reject, file, tracker, attempts - 1);
|
||||
}, 1000);
|
||||
}
|
||||
};
|
||||
xhr.onabort = function () {
|
||||
tracker[file].final = true;
|
||||
reject(new Error(`Loading file '${file}' was aborted.`));
|
||||
};
|
||||
xhr.onloadstart = function (ev) {
|
||||
tracker[file].total = ev.total;
|
||||
tracker[file].loaded = ev.loaded;
|
||||
};
|
||||
xhr.onprogress = function (ev) {
|
||||
tracker[file].loaded = ev.loaded;
|
||||
tracker[file].total = ev.total;
|
||||
};
|
||||
xhr.onload = function () {
|
||||
if (xhr.status >= 400) {
|
||||
if (xhr.status < 500 || attempts <= 1) {
|
||||
reject(new Error(`Failed loading file '${file}': ${xhr.statusText}`));
|
||||
xhr.abort();
|
||||
} else {
|
||||
setTimeout(function () {
|
||||
loadXHR(resolve, reject, file, tracker, attempts - 1);
|
||||
}, 1000);
|
||||
}
|
||||
} else {
|
||||
tracker[file].final = true;
|
||||
resolve(xhr);
|
||||
}
|
||||
};
|
||||
// Make request.
|
||||
xhr.open('GET', file);
|
||||
if (!file.endsWith('.js')) {
|
||||
xhr.responseType = 'arraybuffer';
|
||||
}
|
||||
xhr.send();
|
||||
};
|
||||
|
||||
const DOWNLOAD_ATTEMPTS_MAX = 4;
|
||||
const loadingFiles = {};
|
||||
const lastProgress = { loaded: 0, total: 0 };
|
||||
let progressFunc = null;
|
||||
|
||||
const animateProgress = function () {
|
||||
let loaded = 0;
|
||||
let total = 0;
|
||||
let totalIsValid = true;
|
||||
let progressIsFinal = true;
|
||||
|
||||
Object.keys(loadingFiles).forEach(function (file) {
|
||||
const stat = loadingFiles[file];
|
||||
if (!stat.final) {
|
||||
progressIsFinal = false;
|
||||
}
|
||||
if (!totalIsValid || stat.total === 0) {
|
||||
totalIsValid = false;
|
||||
total = 0;
|
||||
} else {
|
||||
total += stat.total;
|
||||
}
|
||||
loaded += stat.loaded;
|
||||
});
|
||||
if (loaded !== lastProgress.loaded || total !== lastProgress.total) {
|
||||
lastProgress.loaded = loaded;
|
||||
lastProgress.total = total;
|
||||
if (typeof progressFunc === 'function') {
|
||||
progressFunc(loaded, total);
|
||||
}
|
||||
}
|
||||
if (!progressIsFinal) {
|
||||
requestAnimationFrame(animateProgress);
|
||||
}
|
||||
};
|
||||
|
||||
this.animateProgress = animateProgress;
|
||||
|
||||
this.setProgressFunc = function (callback) {
|
||||
progressFunc = callback;
|
||||
};
|
||||
|
||||
this.loadPromise = function (file) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
loadXHR(resolve, reject, file, loadingFiles, DOWNLOAD_ATTEMPTS_MAX);
|
||||
});
|
||||
};
|
||||
|
||||
this.preloadedFiles = [];
|
||||
this.preload = function (pathOrBuffer, destPath) {
|
||||
let buffer = null;
|
||||
if (typeof pathOrBuffer === 'string') {
|
||||
const me = this;
|
||||
return this.loadPromise(pathOrBuffer).then(function (xhr) {
|
||||
me.preloadedFiles.push({
|
||||
path: destPath || pathOrBuffer,
|
||||
buffer: xhr.response,
|
||||
});
|
||||
return Promise.resolve();
|
||||
});
|
||||
} else if (pathOrBuffer instanceof ArrayBuffer) {
|
||||
buffer = new Uint8Array(pathOrBuffer);
|
||||
} else if (ArrayBuffer.isView(pathOrBuffer)) {
|
||||
buffer = new Uint8Array(pathOrBuffer.buffer);
|
||||
}
|
||||
if (buffer) {
|
||||
this.preloadedFiles.push({
|
||||
path: destPath,
|
||||
buffer: pathOrBuffer,
|
||||
});
|
||||
return Promise.resolve();
|
||||
}
|
||||
return Promise.reject(new Error('Invalid object for preloading'));
|
||||
};
|
||||
};
|
||||
|
||||
const Utils = { // eslint-disable-line no-unused-vars
|
||||
|
||||
createLocateRewrite: function (execName) {
|
||||
function rw(path) {
|
||||
if (path.endsWith('.worker.js')) {
|
||||
return `${execName}.worker.js`;
|
||||
} else if (path.endsWith('.audio.worklet.js')) {
|
||||
return `${execName}.audio.worklet.js`;
|
||||
} else if (path.endsWith('.js')) {
|
||||
return `${execName}.js`;
|
||||
} else if (path.endsWith('.side.wasm')) {
|
||||
return `${execName}.side.wasm`;
|
||||
} else if (path.endsWith('.wasm')) {
|
||||
return `${execName}.wasm`;
|
||||
}
|
||||
return path;
|
||||
}
|
||||
return rw;
|
||||
},
|
||||
|
||||
createInstantiatePromise: function (wasmLoader) {
|
||||
let loader = wasmLoader;
|
||||
function instantiateWasm(imports, onSuccess) {
|
||||
loader.then(function (xhr) {
|
||||
WebAssembly.instantiate(xhr.response, imports).then(function (result) {
|
||||
onSuccess(result['instance'], result['module']);
|
||||
});
|
||||
});
|
||||
loader = null;
|
||||
return {};
|
||||
}
|
||||
|
||||
return instantiateWasm;
|
||||
},
|
||||
|
||||
findCanvas: function () {
|
||||
const nodes = document.getElementsByTagName('canvas');
|
||||
if (nodes.length && nodes[0] instanceof HTMLCanvasElement) {
|
||||
return nodes[0];
|
||||
}
|
||||
return null;
|
||||
},
|
||||
|
||||
isWebGLAvailable: function (majorVersion = 1) {
|
||||
let testContext = false;
|
||||
try {
|
||||
const testCanvas = document.createElement('canvas');
|
||||
if (majorVersion === 1) {
|
||||
testContext = testCanvas.getContext('webgl') || testCanvas.getContext('experimental-webgl');
|
||||
} else if (majorVersion === 2) {
|
||||
testContext = testCanvas.getContext('webgl2') || testCanvas.getContext('experimental-webgl2');
|
||||
}
|
||||
} catch (e) {
|
||||
// Not available
|
||||
}
|
||||
return !!testContext;
|
||||
},
|
||||
};
|
||||
|
||||
const Engine = (function () {
|
||||
const preloader = new Preloader();
|
||||
|
||||
let wasmExt = '.wasm';
|
||||
let unloadAfterInit = true;
|
||||
let loadPath = '';
|
||||
let loadPromise = null;
|
||||
let initPromise = null;
|
||||
let stderr = null;
|
||||
let stdout = null;
|
||||
let progressFunc = null;
|
||||
|
||||
function load(basePath) {
|
||||
if (loadPromise == null) {
|
||||
loadPath = basePath;
|
||||
loadPromise = preloader.loadPromise(basePath + wasmExt);
|
||||
preloader.setProgressFunc(progressFunc);
|
||||
requestAnimationFrame(preloader.animateProgress);
|
||||
}
|
||||
return loadPromise;
|
||||
}
|
||||
|
||||
function unload() {
|
||||
loadPromise = null;
|
||||
}
|
||||
|
||||
/** @constructor */
|
||||
function Engine() { // eslint-disable-line no-shadow
|
||||
this.canvas = null;
|
||||
this.executableName = '';
|
||||
this.rtenv = null;
|
||||
this.customLocale = null;
|
||||
this.resizeCanvasOnStart = false;
|
||||
this.onExecute = null;
|
||||
this.onExit = null;
|
||||
this.persistentPaths = ['/userfs'];
|
||||
this.gdnativeLibs = [];
|
||||
}
|
||||
|
||||
Engine.prototype.init = /** @param {string=} basePath */ function (basePath) {
|
||||
if (initPromise) {
|
||||
return initPromise;
|
||||
}
|
||||
if (loadPromise == null) {
|
||||
if (!basePath) {
|
||||
initPromise = Promise.reject(new Error('A base path must be provided when calling `init` and the engine is not loaded.'));
|
||||
return initPromise;
|
||||
}
|
||||
load(basePath);
|
||||
}
|
||||
let config = {};
|
||||
if (typeof stdout === 'function') {
|
||||
config.print = stdout;
|
||||
}
|
||||
if (typeof stderr === 'function') {
|
||||
config.printErr = stderr;
|
||||
}
|
||||
const me = this;
|
||||
initPromise = new Promise(function (resolve, reject) {
|
||||
config['locateFile'] = Utils.createLocateRewrite(loadPath);
|
||||
config['instantiateWasm'] = Utils.createInstantiatePromise(loadPromise);
|
||||
// Emscripten configuration.
|
||||
config['thisProgram'] = me.executableName;
|
||||
config['noExitRuntime'] = true;
|
||||
config['dynamicLibraries'] = me.gdnativeLibs;
|
||||
Godot(config).then(function (module) {
|
||||
module['initFS'](me.persistentPaths).then(function (fs_err) {
|
||||
me.rtenv = module;
|
||||
if (unloadAfterInit) {
|
||||
unload();
|
||||
}
|
||||
resolve();
|
||||
config = null;
|
||||
});
|
||||
});
|
||||
});
|
||||
return initPromise;
|
||||
};
|
||||
|
||||
/** @type {function(string, string):Object} */
|
||||
Engine.prototype.preloadFile = function (file, path) {
|
||||
return preloader.preload(file, path);
|
||||
};
|
||||
|
||||
/** @type {function(...string):Object} */
|
||||
Engine.prototype.start = function () {
|
||||
// Start from arguments.
|
||||
const args = [];
|
||||
for (let i = 0; i < arguments.length; i++) {
|
||||
args.push(arguments[i]);
|
||||
}
|
||||
const me = this;
|
||||
return me.init().then(function () {
|
||||
if (!me.rtenv) {
|
||||
return Promise.reject(new Error('The engine must be initialized before it can be started'));
|
||||
}
|
||||
|
||||
if (!(me.canvas instanceof HTMLCanvasElement)) {
|
||||
me.canvas = Utils.findCanvas();
|
||||
if (!me.canvas) {
|
||||
return Promise.reject(new Error('No canvas found in page'));
|
||||
}
|
||||
}
|
||||
|
||||
// Canvas can grab focus on click, or key events won't work.
|
||||
if (me.canvas.tabIndex < 0) {
|
||||
me.canvas.tabIndex = 0;
|
||||
}
|
||||
|
||||
// Disable right-click context menu.
|
||||
me.canvas.addEventListener('contextmenu', function (ev) {
|
||||
ev.preventDefault();
|
||||
}, false);
|
||||
|
||||
// Until context restoration is implemented warn the user of context loss.
|
||||
me.canvas.addEventListener('webglcontextlost', function (ev) {
|
||||
alert('WebGL context lost, please reload the page'); // eslint-disable-line no-alert
|
||||
ev.preventDefault();
|
||||
}, false);
|
||||
|
||||
// Browser locale, or custom one if defined.
|
||||
let locale = me.customLocale;
|
||||
if (!locale) {
|
||||
locale = navigator.languages ? navigator.languages[0] : navigator.language;
|
||||
locale = locale.split('.')[0];
|
||||
}
|
||||
// Godot configuration.
|
||||
me.rtenv['initConfig']({
|
||||
'resizeCanvasOnStart': me.resizeCanvasOnStart,
|
||||
'canvas': me.canvas,
|
||||
'locale': locale,
|
||||
'onExecute': function (p_args) {
|
||||
if (me.onExecute) {
|
||||
me.onExecute(p_args);
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
},
|
||||
'onExit': function (p_code) {
|
||||
me.rtenv['deinitFS']();
|
||||
if (me.onExit) {
|
||||
me.onExit(p_code);
|
||||
}
|
||||
me.rtenv = null;
|
||||
},
|
||||
});
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
preloader.preloadedFiles.forEach(function (file) {
|
||||
me.rtenv['copyToFS'](file.path, file.buffer);
|
||||
});
|
||||
preloader.preloadedFiles.length = 0; // Clear memory
|
||||
me.rtenv['callMain'](args);
|
||||
initPromise = null;
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
Engine.prototype.startGame = function (execName, mainPack, extraArgs) {
|
||||
// Start and init with execName as loadPath if not inited.
|
||||
this.executableName = execName;
|
||||
const me = this;
|
||||
return Promise.all([
|
||||
this.init(execName),
|
||||
this.preloadFile(mainPack, mainPack),
|
||||
]).then(function () {
|
||||
let args = ['--main-pack', mainPack];
|
||||
if (extraArgs) {
|
||||
args = args.concat(extraArgs);
|
||||
}
|
||||
return me.start.apply(me, args);
|
||||
});
|
||||
};
|
||||
|
||||
Engine.prototype.setWebAssemblyFilenameExtension = function (override) {
|
||||
if (String(override).length === 0) {
|
||||
throw new Error('Invalid WebAssembly filename extension override');
|
||||
}
|
||||
wasmExt = String(override);
|
||||
};
|
||||
|
||||
Engine.prototype.setUnloadAfterInit = function (enabled) {
|
||||
unloadAfterInit = enabled;
|
||||
};
|
||||
|
||||
Engine.prototype.setCanvas = function (canvasElem) {
|
||||
this.canvas = canvasElem;
|
||||
};
|
||||
|
||||
Engine.prototype.setCanvasResizedOnStart = function (enabled) {
|
||||
this.resizeCanvasOnStart = enabled;
|
||||
};
|
||||
|
||||
Engine.prototype.setLocale = function (locale) {
|
||||
this.customLocale = locale;
|
||||
};
|
||||
|
||||
Engine.prototype.setExecutableName = function (newName) {
|
||||
this.executableName = newName;
|
||||
};
|
||||
|
||||
Engine.prototype.setProgressFunc = function (func) {
|
||||
progressFunc = func;
|
||||
};
|
||||
|
||||
Engine.prototype.setStdoutFunc = function (func) {
|
||||
const print = function (text) {
|
||||
let msg = text;
|
||||
if (arguments.length > 1) {
|
||||
msg = Array.prototype.slice.call(arguments).join(' ');
|
||||
}
|
||||
func(msg);
|
||||
};
|
||||
if (this.rtenv) {
|
||||
this.rtenv.print = print;
|
||||
}
|
||||
stdout = print;
|
||||
};
|
||||
|
||||
Engine.prototype.setStderrFunc = function (func) {
|
||||
const printErr = function (text) {
|
||||
let msg = text;
|
||||
if (arguments.length > 1) {
|
||||
msg = Array.prototype.slice.call(arguments).join(' ');
|
||||
}
|
||||
func(msg);
|
||||
};
|
||||
if (this.rtenv) {
|
||||
this.rtenv.printErr = printErr;
|
||||
}
|
||||
stderr = printErr;
|
||||
};
|
||||
|
||||
Engine.prototype.setOnExecute = function (onExecute) {
|
||||
this.onExecute = onExecute;
|
||||
};
|
||||
|
||||
Engine.prototype.setOnExit = function (onExit) {
|
||||
this.onExit = onExit;
|
||||
};
|
||||
|
||||
Engine.prototype.copyToFS = function (path, buffer) {
|
||||
if (this.rtenv == null) {
|
||||
throw new Error('Engine must be inited before copying files');
|
||||
}
|
||||
this.rtenv['copyToFS'](path, buffer);
|
||||
};
|
||||
|
||||
Engine.prototype.setPersistentPaths = function (persistentPaths) {
|
||||
this.persistentPaths = persistentPaths;
|
||||
};
|
||||
|
||||
Engine.prototype.setGDNativeLibraries = function (gdnativeLibs) {
|
||||
this.gdnativeLibs = gdnativeLibs;
|
||||
};
|
||||
|
||||
Engine.prototype.requestQuit = function () {
|
||||
if (this.rtenv) {
|
||||
this.rtenv['request_quit']();
|
||||
}
|
||||
};
|
||||
|
||||
// Closure compiler exported engine methods.
|
||||
/** @export */
|
||||
Engine['isWebGLAvailable'] = Utils.isWebGLAvailable;
|
||||
Engine['load'] = load;
|
||||
Engine['unload'] = unload;
|
||||
Engine.prototype['init'] = Engine.prototype.init;
|
||||
Engine.prototype['preloadFile'] = Engine.prototype.preloadFile;
|
||||
Engine.prototype['start'] = Engine.prototype.start;
|
||||
Engine.prototype['startGame'] = Engine.prototype.startGame;
|
||||
Engine.prototype['setWebAssemblyFilenameExtension'] = Engine.prototype.setWebAssemblyFilenameExtension;
|
||||
Engine.prototype['setUnloadAfterInit'] = Engine.prototype.setUnloadAfterInit;
|
||||
Engine.prototype['setCanvas'] = Engine.prototype.setCanvas;
|
||||
Engine.prototype['setCanvasResizedOnStart'] = Engine.prototype.setCanvasResizedOnStart;
|
||||
Engine.prototype['setLocale'] = Engine.prototype.setLocale;
|
||||
Engine.prototype['setExecutableName'] = Engine.prototype.setExecutableName;
|
||||
Engine.prototype['setProgressFunc'] = Engine.prototype.setProgressFunc;
|
||||
Engine.prototype['setStdoutFunc'] = Engine.prototype.setStdoutFunc;
|
||||
Engine.prototype['setStderrFunc'] = Engine.prototype.setStderrFunc;
|
||||
Engine.prototype['setOnExecute'] = Engine.prototype.setOnExecute;
|
||||
Engine.prototype['setOnExit'] = Engine.prototype.setOnExit;
|
||||
Engine.prototype['copyToFS'] = Engine.prototype.copyToFS;
|
||||
Engine.prototype['setPersistentPaths'] = Engine.prototype.setPersistentPaths;
|
||||
Engine.prototype['setGDNativeLibraries'] = Engine.prototype.setGDNativeLibraries;
|
||||
Engine.prototype['requestQuit'] = Engine.prototype.requestQuit;
|
||||
return Engine;
|
||||
}());
|
||||
if (typeof window !== 'undefined') {
|
||||
window['Engine'] = Engine;
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
@@ -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
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
+26
-2
@@ -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
|
||||
@@ -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 )
|
||||
+11
-12
@@ -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_": ""
|
||||
}
|
||||
|
||||
@@ -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
|
||||
@@ -1,2 +1,2 @@
|
||||
:exit_scene
|
||||
#change_scene "res://game/rooms/room9/room9.tscn"
|
||||
change_scene "res://game/rooms/room9/room9.tscn"
|
||||
@@ -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 )
|
||||
@@ -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="."]
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
# Magical closet: the object is always in the LAST opened closet
|
||||
|
||||
:open
|
||||
|
||||
|
||||
Executable
+2
@@ -0,0 +1,2 @@
|
||||
:exit_scene
|
||||
change_scene "res://game/rooms/room7/room7.tscn"
|
||||
Executable
+9
@@ -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
|
||||
|
||||
@@ -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 |
@@ -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 |
@@ -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 |
@@ -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 |
@@ -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
|
||||
@@ -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 )
|
||||
@@ -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_": ""
|
||||
}
|
||||
+5
-2
@@ -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
|
||||
@@ -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()
|
||||
@@ -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()
|
||||
Reference in new issue
Block a user