Updated to Godot version 4.5

This commit is contained in:
2025-11-13 07:26:39 +01:00
parent 5d80182781
commit 0bffac21cb
19 changed files with 343 additions and 22 deletions

1
Level.gd.uid Normal file
View File

@@ -0,0 +1 @@
uid://sfad1ghbu2g4

File diff suppressed because one or more lines are too long

1
MyChar.gd.uid Normal file
View File

@@ -0,0 +1 @@
uid://dn33dxgf1ucx7

View File

@@ -1,6 +1,6 @@
[gd_scene load_steps=6 format=3 uid="uid://crht8e77338ew"] [gd_scene load_steps=6 format=3 uid="uid://crht8e77338ew"]
[ext_resource type="Script" path="res://MyChar.gd" id="1_nu61o"] [ext_resource type="Script" uid="uid://dn33dxgf1ucx7" path="res://MyChar.gd" id="1_nu61o"]
[ext_resource type="Texture2D" uid="uid://dg8dggk5xu5ru" path="res://player1.png" id="2_hro3h"] [ext_resource type="Texture2D" uid="uid://dg8dggk5xu5ru" path="res://player1.png" id="2_hro3h"]
[ext_resource type="Texture2D" uid="uid://cgvpelj36koye" path="res://player2.png" id="3_q8tsx"] [ext_resource type="Texture2D" uid="uid://cgvpelj36koye" path="res://player2.png" id="3_q8tsx"]

1
PlayerController.gd.uid Normal file
View File

@@ -0,0 +1 @@
uid://sbc4wnladptt

View File

@@ -1,6 +1,6 @@
[gd_scene load_steps=4 format=3 uid="uid://cynystnt5cwlg"] [gd_scene load_steps=4 format=3 uid="uid://cynystnt5cwlg"]
[ext_resource type="Script" path="res://PlayerController.gd" id="1_1rp1b"] [ext_resource type="Script" uid="uid://sbc4wnladptt" path="res://PlayerController.gd" id="1_1rp1b"]
[ext_resource type="Texture2D" uid="uid://d2xwesqf3dwgn" path="res://analog_stick_back.png" id="2_c8ft0"] [ext_resource type="Texture2D" uid="uid://d2xwesqf3dwgn" path="res://analog_stick_back.png" id="2_c8ft0"]
[ext_resource type="Texture2D" uid="uid://dvwlyke01vja6" path="res://analog_stick.png" id="3_y2opl"] [ext_resource type="Texture2D" uid="uid://dvwlyke01vja6" path="res://analog_stick.png" id="3_y2opl"]
@@ -8,6 +8,7 @@
script = ExtResource("1_1rp1b") script = ExtResource("1_1rp1b")
[node name="controller_overlay" type="CanvasLayer" parent="."] [node name="controller_overlay" type="CanvasLayer" parent="."]
visible = false
[node name="analog_stick_area" type="Control" parent="controller_overlay"] [node name="analog_stick_area" type="Control" parent="controller_overlay"]
modulate = Color(1, 1, 1, 0.784314) modulate = Color(1, 1, 1, 0.784314)

21
docs/cert.pem Normal file
View File

@@ -0,0 +1,21 @@
-----BEGIN CERTIFICATE-----
MIIDZTCCAk2gAwIBAgIUefcljMQFIGJmmOmI5h/PU2btwZEwDQYJKoZIhvcNAQEL
BQAwQjELMAkGA1UEBhMCWFgxFTATBgNVBAcMDERlZmF1bHQgQ2l0eTEcMBoGA1UE
CgwTRGVmYXVsdCBDb21wYW55IEx0ZDAeFw0yNDExMDIxMTMzMzlaFw0zNDEwMzEx
MTMzMzlaMEIxCzAJBgNVBAYTAlhYMRUwEwYDVQQHDAxEZWZhdWx0IENpdHkxHDAa
BgNVBAoME0RlZmF1bHQgQ29tcGFueSBMdGQwggEiMA0GCSqGSIb3DQEBAQUAA4IB
DwAwggEKAoIBAQCpsi0uVZ3MWRidsWfOn04JDSANFoCn1+98KQjUePFlK28F81Fx
liM0fhl1iklCFA4dhdF98j2HNNNIogDDOglc9+gGtSvpLmbT3yYDXU+SN0kpJ3w7
avcQH+lQ6WOdZKbNWp3WrC8xyQuQyw9OKq3ZiOrirwFaxPg0qOa2EnoAJwMryq6/
pa2eWTpLJhBJyiaqoFGCMbEPyeIyC+NxdoeS/iQDeN7/lbfOg2zUzECWtQ5Kvm/s
AmRFlQhPUDzz1gLvILoL4NTbfLVepcYMZvcTiJBYdtElb1fKuSjwONvVodgBdzyD
nLrDpNJ5yC5Z5g5lm1IFOnbk1B3UljRKNMlRAgMBAAGjUzBRMB0GA1UdDgQWBBTc
fy0C6a1mCbL7GB1om/ycMBDmlDAfBgNVHSMEGDAWgBTcfy0C6a1mCbL7GB1om/yc
MBDmlDAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQBAk8xzEzYz
TvkMcmbgWHKyFWioO4TmXHDwQRos35jWHqA+4ixmduuJRe5KhnUDSTP/L1NhXnGV
m1PAU8kxG/6fGfOq/3KxM7vAekXcoLHxH/AHra+//UrYx7vKLViujh0UEocjnjoA
wVhe9ZeFy3jBd+VfSX2RyCb3rBwozbS8oXfZTGXRjszzYXuMpEdv/0c22Pv91oE2
Lrm2whrSB70EV1NwDcilqv35j0HS1qFtDsSL+8mENizd2P0DY6UPbrIWNk6XP5U/
Hpyl7Fzfsx2IlOpLE0laf0S3HqDHrNgTxfCke6vikP37LD7AaPPISCMqk5M1Zypu
Lyb5OD9E9brN
-----END CERTIFICATE-----

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -0,0 +1,66 @@
/**************************************************************************/
/* godot.audio.position.worklet.js */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/**************************************************************************/
/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
/* */
/* 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 GodotPositionReportingProcessor extends AudioWorkletProcessor {
static get parameterDescriptors() {
return [
{
name: 'reset',
defaultValue: 0,
minValue: 0,
maxValue: 1,
automationRate: 'k-rate',
},
];
}
constructor(...args) {
super(...args);
this.position = 0;
}
process(inputs, _outputs, parameters) {
if (parameters['reset'][0] > 0) {
this.position = 0;
}
if (inputs.length > 0) {
const input = inputs[0];
if (input.length > 0) {
this.position += input[0].length;
this.port.postMessage({ type: 'position', data: this.position });
}
}
return true;
}
}
registerProcessor('godot-position-reporting-processor', GodotPositionReportingProcessor);

View File

@@ -52,6 +52,20 @@ body {
margin: auto; margin: auto;
} }
#status-splash.show-image--false {
display: none;
}
#status-splash.fullsize--true {
height: 100%;
width: 100%;
object-fit: contain;
}
#status-splash.use-filter--false {
image-rendering: pixelated;
}
#status-progress, #status-notice { #status-progress, #status-notice {
display: none; display: none;
} }
@@ -90,14 +104,14 @@ body {
</noscript> </noscript>
<div id="status"> <div id="status">
<img id="status-splash" src="index.png" alt=""> <img id="status-splash" class="show-image--true fullsize--true use-filter--true" src="index.png" alt="">
<progress id="status-progress"></progress> <progress id="status-progress"></progress>
<div id="status-notice"></div> <div id="status-notice"></div>
</div> </div>
<script src="index.js"></script> <script src="index.js"></script>
<script> <script>
const GODOT_CONFIG = {"args":[],"canvasResizePolicy":2,"ensureCrossOriginIsolationHeaders":true,"executable":"index","experimentalVK":false,"fileSizes":{"index.pck":72208,"index.wasm":43016933},"focusCanvas":true,"gdextensionLibs":[]}; const GODOT_CONFIG = {"args":[],"canvasResizePolicy":2,"emscriptenPoolSize":8,"ensureCrossOriginIsolationHeaders":true,"executable":"index","experimentalVK":false,"fileSizes":{"index.pck":72444,"index.wasm":38034280},"focusCanvas":true,"gdextensionLibs":[],"godotPoolSize":4};
const GODOT_THREADS_ENABLED = false; const GODOT_THREADS_ENABLED = false;
const engine = new Engine(GODOT_CONFIG); const engine = new Engine(GODOT_CONFIG);
@@ -142,7 +156,7 @@ const engine = new Engine(GODOT_CONFIG);
} else if (typeof err === 'string') { } else if (typeof err === 'string') {
setStatusNotice(err); setStatusNotice(err);
} else { } else {
setStatusNotice('An unknown error occured'); setStatusNotice('An unknown error occurred.');
} }
setStatusMode('notice'); setStatusMode('notice');
initializing = false; initializing = false;
@@ -154,9 +168,15 @@ const engine = new Engine(GODOT_CONFIG);
if (missing.length !== 0) { if (missing.length !== 0) {
if (GODOT_CONFIG['serviceWorker'] && GODOT_CONFIG['ensureCrossOriginIsolationHeaders'] && 'serviceWorker' in navigator) { if (GODOT_CONFIG['serviceWorker'] && GODOT_CONFIG['ensureCrossOriginIsolationHeaders'] && 'serviceWorker' in navigator) {
let serviceWorkerRegistrationPromise;
try {
serviceWorkerRegistrationPromise = navigator.serviceWorker.getRegistration();
} catch (err) {
serviceWorkerRegistrationPromise = Promise.reject(new Error('Service worker registration failed.'));
}
// There's a chance that installing the service worker would fix the issue // There's a chance that installing the service worker would fix the issue
Promise.race([ Promise.race([
navigator.serviceWorker.getRegistration().then((registration) => { serviceWorkerRegistrationPromise.then((registration) => {
if (registration != null) { if (registration != null) {
return Promise.reject(new Error('Service worker already exists.')); return Promise.reject(new Error('Service worker already exists.'));
} }
@@ -166,10 +186,11 @@ const engine = new Engine(GODOT_CONFIG);
new Promise((resolve) => { new Promise((resolve) => {
setTimeout(() => resolve(), 2000); setTimeout(() => resolve(), 2000);
}), }),
]).catch((err) => { ]).then(() => {
console.error('Error while registering service worker:', err); // Reload if there was no error.
}).then(() => {
window.location.reload(); window.location.reload();
}).catch((err) => {
console.error('Error while registering service worker:', err);
}); });
} else { } else {
// Display the message as usual // Display the message as usual

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

28
docs/key.pem Normal file
View File

@@ -0,0 +1,28 @@
-----BEGIN PRIVATE KEY-----
MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCpsi0uVZ3MWRid
sWfOn04JDSANFoCn1+98KQjUePFlK28F81FxliM0fhl1iklCFA4dhdF98j2HNNNI
ogDDOglc9+gGtSvpLmbT3yYDXU+SN0kpJ3w7avcQH+lQ6WOdZKbNWp3WrC8xyQuQ
yw9OKq3ZiOrirwFaxPg0qOa2EnoAJwMryq6/pa2eWTpLJhBJyiaqoFGCMbEPyeIy
C+NxdoeS/iQDeN7/lbfOg2zUzECWtQ5Kvm/sAmRFlQhPUDzz1gLvILoL4NTbfLVe
pcYMZvcTiJBYdtElb1fKuSjwONvVodgBdzyDnLrDpNJ5yC5Z5g5lm1IFOnbk1B3U
ljRKNMlRAgMBAAECggEAEqmZRXC+B3S++8zAbV1gwCcU4MuaP5tEZ8O9iFx6s9Uo
gx+E0/iei43Yr/AS6XT6Lm4CoZbMBHwfRmwmqFHQKMzM1DwFhcIIJgHzFMik0SBK
Z//DLmevnzLbPn5EadFhdNEj7bGHCTMilfx3BPI1p2hi6KY1gG2MHIJ8yQZUK4Lw
zxpI95qzcjz3FFE/4VhymRzNyhdsMy1ec3cuCTqjnkrHzr8RhI/aIiAaX7MTw73A
dj0u+yVzG7LOxzPTYWf2Ke9eW6CQGqqZQqhwckSXSMB6fji9goO4eHDsGGHl8h6k
8EmoimeTfrPH9EGZQUEQ1sAD+4TukRaoIx2h/ZpeCQKBgQDk4WQvaX/M8QN1luXa
RGNFWcD0LOLNl1qQIuivO+jKKrCLbIR/6fPpgPqbrJARREeEfOoyS8Qr6q3JP0AF
wg4UBIknEmSSaS+PQMCarWB0vFuS0E1alluE4ACKxZakNQv2hblbOvkk2jrTEXkf
KTY2Dgx2LQArn45I7qj0duhqdQKBgQC9zYyfxNXn47eTQJKtl0hfJ/DcZ5MuLiCo
/yZGt7SIFCnKMLyP+J42KPEikp1rDYn/zAe8HRNSi3XNB7Htu91v8PLhxcp7ID8M
9eTqxfmB633trvm3zCS2p/fEvyMRJG1aH+MlI8Q/nAt6LQ/fFeT+zCKXBrTvwZ2E
2O9k+Cvv7QKBgEwPhu6mnZzqnx6ttdbSETdTu2apn/l4idUKdM7/Fr5Qb3j16BZm
FfOMNDwVnY7PZQDnTiDGwvthMr2FMm53bZxDYZzFZPyuzepKN3dvlHVWvwvMA1jO
TL2cfzGetg/9vOsAx3dE4tTXXOMVlG3BkU1nX8bJ75uPm4YrIaST+2qdAoGANuGm
ldQOnfykajmzr+ocjRc5eCGi1ymTXApbAPvBgc+CveoVu/OBm9t+ziZiyj+h9YsD
eYtWuPmGWICvHDTENMgREuNkRvHuCUtYo+IW4VA8m2uK3XBz9TTgWc2C0EQeMn8h
6O1Mo6/1SaCaBEGKc3qHTfAshV8QswcfQazY14kCgYAHzRH/lW1lgNdoXgm2NQZL
5m5XkeTS1FBnvAvSyjztZ0VGPnWuZjE12g9LOH1xEpjllXo4wUtc22BBVnxOhjp5
bWiQ8MPjxtd46dmGSb8WXsQSnruq8fpih4ZYzrGUcIVFy+/d+HGvG/mwNHVqFvyi
vVlLe3Q0lSO4WbmNTubIhQ==
-----END PRIVATE KEY-----

78
docs/serve.py Executable file
View File

@@ -0,0 +1,78 @@
#!/usr/bin/env python3
import argparse
import contextlib
import os
import socket
import subprocess
import sys
from http.server import HTTPServer, SimpleHTTPRequestHandler
from pathlib import Path
# See cpython GH-17851 and GH-17864.
class DualStackServer(HTTPServer):
def server_bind(self):
# Suppress exception when protocol is IPv4.
with contextlib.suppress(Exception):
self.socket.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_V6ONLY, 0)
return super().server_bind()
class CORSRequestHandler(SimpleHTTPRequestHandler):
def end_headers(self):
self.send_header("Cross-Origin-Opener-Policy", "same-origin")
self.send_header("Cross-Origin-Embedder-Policy", "require-corp")
self.send_header("Access-Control-Allow-Origin", "*")
super().end_headers()
def shell_open(url):
if sys.platform == "win32":
os.startfile(url)
else:
opener = "open" if sys.platform == "darwin" else "xdg-open"
subprocess.call([opener, url])
def serve(root, port, run_browser):
os.chdir(root)
address = ("", port)
httpd = DualStackServer(address, CORSRequestHandler)
url = f"http://127.0.0.1:{port}"
if run_browser:
# Open the served page in the user's default browser.
print(f"Opening the served URL in the default browser (use `--no-browser` or `-n` to disable this): {url}")
shell_open(url)
else:
print(f"Serving at: {url}")
try:
httpd.serve_forever()
except KeyboardInterrupt:
print("\nKeyboard interrupt received, stopping server.")
finally:
# Clean-up server
httpd.server_close()
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("-p", "--port", help="port to listen on", default=8080, type=int)
parser.add_argument(
"-r", "--root", help="path to serve as root (relative to `platform/web/`)", default=".", type=Path
)
browser_parser = parser.add_mutually_exclusive_group(required=False)
browser_parser.add_argument(
"-n", "--no-browser", help="don't open default web browser automatically", dest="browser", action="store_false"
)
parser.set_defaults(browser=True)
args = parser.parse_args()
# Change to the directory where the script is located,
# so that the script can be run from any location.
os.chdir(Path(__file__).resolve().parent)
serve(args.root, args.port, args.browser)

78
docs/serve_https.py Executable file
View File

@@ -0,0 +1,78 @@
#!/usr/bin/env python3
import os, sys, socket, ssl, subprocess, argparse, contextlib
from http.server import HTTPServer, SimpleHTTPRequestHandler
from pathlib import Path
# See cpython GH-17851 and GH-17864.
class DualStackServer(HTTPServer):
def server_bind(self):
# Suppress exception when protocol is IPv4.
with contextlib.suppress(Exception):
self.socket.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_V6ONLY, 0)
return super().server_bind()
class CORSRequestHandler(SimpleHTTPRequestHandler):
def end_headers(self):
self.send_header("Cross-Origin-Opener-Policy", "same-origin")
self.send_header("Cross-Origin-Embedder-Policy", "require-corp")
self.send_header("Access-Control-Allow-Origin", "*")
super().end_headers()
def shell_open(url):
if sys.platform == "win32":
os.startfile(url)
else:
opener = "open" if sys.platform == "darwin" else "xdg-open"
subprocess.call([opener, url])
def serve(root, port, run_browser):
os.chdir(root)
address = ("", port)
httpd = DualStackServer(address, CORSRequestHandler)
url = f"https://127.0.0.1:{port}"
if run_browser:
# Open the served page in the user's default browser.
print(f"Opening the served URL in the default browser (use `--no-browser` or `-n` to disable this): {url}")
shell_open(url)
else:
print(f"Serving at: {url}")
context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
#context.load_default_certs()
context.load_cert_chain("cert.pem", "key.pem")
context.set_ciphers("@SECLEVEL=1:ALL")
httpd.socket = context.wrap_socket(httpd.socket, server_side=True)
try:
httpd.serve_forever()
except KeyboardInterrupt:
print("\nKeyboard interrupt received, stopping server.")
finally:
# Clean-up server
httpd.server_close()
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("-p", "--port", help="port to listen on", default=8080, type=int)
parser.add_argument(
"-r", "--root", help="path to serve as root (relative to `platform/web/`)", default=".", type=Path
)
browser_parser = parser.add_mutually_exclusive_group(required=False)
browser_parser.add_argument(
"-n", "--no-browser", help="don't open default web browser automatically", dest="browser", action="store_false"
)
parser.set_defaults(browser=True)
args = parser.parse_args()
# Change to the directory where the script is located,
# so that the script can be run from any location.
os.chdir(Path(__file__).resolve().parent)
serve(args.root, args.port, args.browser)

View File

@@ -10,8 +10,10 @@ export_filter="all_resources"
include_filter="" include_filter=""
exclude_filter="" exclude_filter=""
export_path="./demo.x86_64" export_path="./demo.x86_64"
patches=PackedStringArray()
encryption_include_filters="" encryption_include_filters=""
encryption_exclude_filters="" encryption_exclude_filters=""
seed=0
encrypt_pck=false encrypt_pck=false
encrypt_directory=false encrypt_directory=false
script_export_mode=2 script_export_mode=2
@@ -24,6 +26,7 @@ debug/export_console_wrapper=1
binary_format/embed_pck=true binary_format/embed_pck=true
texture_format/s3tc_bptc=true texture_format/s3tc_bptc=true
texture_format/etc2_astc=false texture_format/etc2_astc=false
shader_baker/enabled=false
binary_format/architecture="x86_64" binary_format/architecture="x86_64"
ssh_remote_deploy/enabled=false ssh_remote_deploy/enabled=false
ssh_remote_deploy/host="user@host_ip" ssh_remote_deploy/host="user@host_ip"
@@ -50,8 +53,10 @@ export_filter="all_resources"
include_filter="" include_filter=""
exclude_filter="" exclude_filter=""
export_path="docs/index.html" export_path="docs/index.html"
patches=PackedStringArray()
encryption_include_filters="" encryption_include_filters=""
encryption_exclude_filters="" encryption_exclude_filters=""
seed=0
encrypt_pck=false encrypt_pck=false
encrypt_directory=false encrypt_directory=false
script_export_mode=2 script_export_mode=2
@@ -79,3 +84,5 @@ progressive_web_app/icon_144x144=""
progressive_web_app/icon_180x180="" progressive_web_app/icon_180x180=""
progressive_web_app/icon_512x512="" progressive_web_app/icon_512x512=""
progressive_web_app/background_color=Color(0, 0, 0, 1) progressive_web_app/background_color=Color(0, 0, 0, 1)
threads/emscripten_pool_size=8
threads/godot_pool_size=4

View File

@@ -12,14 +12,13 @@ config_version=5
config/name="Demo Linux Day 2410" config/name="Demo Linux Day 2410"
run/main_scene="res://Level.tscn" run/main_scene="res://Level.tscn"
config/features=PackedStringArray("4.3", "Forward Plus") config/features=PackedStringArray("4.5", "Forward Plus")
config/icon="res://icon.svg" config/icon="res://icon.svg"
[display] [display]
window/size/viewport_width=576 window/size/viewport_width=576
window/size/viewport_height=324 window/size/viewport_height=324
window/size/mode=2
window/stretch/mode="viewport" window/stretch/mode="viewport"
[layer_names] [layer_names]