Compare commits
No commits in common. "0e6ba2b209fda6752f9c805d9b13f5b791435b5f" and "093ed20a0b30f9e17b25b20b830e0cf5cd7843d8" have entirely different histories.
0e6ba2b209
...
093ed20a0b
32
boat.gd
@ -1,32 +0,0 @@
|
|||||||
#@tool
|
|
||||||
#@icon(icon_path: String)
|
|
||||||
class_name Boat
|
|
||||||
extends RigidBody2D
|
|
||||||
## Documentation comments
|
|
||||||
|
|
||||||
#signal
|
|
||||||
#enum
|
|
||||||
#const
|
|
||||||
@export var movement_speed: float = 10.0
|
|
||||||
#var
|
|
||||||
#@onready var
|
|
||||||
@onready var right_cast: RayCast2D = %RightCast
|
|
||||||
@onready var left_cast: RayCast2D = %LeftCast
|
|
||||||
|
|
||||||
## OVERRIDES
|
|
||||||
|
|
||||||
func _ready() -> void:
|
|
||||||
pass
|
|
||||||
|
|
||||||
func _process(_delta: float) -> void:
|
|
||||||
pass
|
|
||||||
|
|
||||||
func _physics_process(delta: float) -> void:
|
|
||||||
apply_central_force(Vector2(movement_speed, 0.0))
|
|
||||||
## CORE
|
|
||||||
|
|
||||||
## PRIVATE/HELPER
|
|
||||||
|
|
||||||
## RECEIVERS
|
|
||||||
|
|
||||||
## SETTERS/GETTERS
|
|
||||||
@ -1 +0,0 @@
|
|||||||
uid://b464eeimyvolw
|
|
||||||
32
boat.tscn
@ -1,32 +0,0 @@
|
|||||||
[gd_scene format=3 uid="uid://drmwx05dw5d3c"]
|
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://iiyslw33af84" path="res://sprites/red.png" id="1_annr2"]
|
|
||||||
[ext_resource type="Script" uid="uid://b464eeimyvolw" path="res://boat.gd" id="1_viw7v"]
|
|
||||||
|
|
||||||
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_annr2"]
|
|
||||||
radius = 16.0
|
|
||||||
height = 100.0
|
|
||||||
|
|
||||||
[node name="Boat" type="RigidBody2D" unique_id=918212763]
|
|
||||||
collision_layer = 8
|
|
||||||
collision_mask = 14
|
|
||||||
script = ExtResource("1_viw7v")
|
|
||||||
|
|
||||||
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=522204430]
|
|
||||||
scale = Vector2(0.1, 0.1)
|
|
||||||
texture = ExtResource("1_annr2")
|
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1042250248]
|
|
||||||
position = Vector2(0, 16)
|
|
||||||
rotation = 1.5707964
|
|
||||||
shape = SubResource("CapsuleShape2D_annr2")
|
|
||||||
|
|
||||||
[node name="RightCast" type="RayCast2D" parent="." unique_id=1726274503]
|
|
||||||
unique_name_in_owner = true
|
|
||||||
target_position = Vector2(100, 0)
|
|
||||||
collision_mask = 8
|
|
||||||
|
|
||||||
[node name="LeftCast" type="RayCast2D" parent="." unique_id=1387764071]
|
|
||||||
unique_name_in_owner = true
|
|
||||||
target_position = Vector2(-100, 0)
|
|
||||||
collision_mask = 8
|
|
||||||
@ -1,49 +0,0 @@
|
|||||||
[preset.0]
|
|
||||||
|
|
||||||
name="Web"
|
|
||||||
platform="Web"
|
|
||||||
runnable=true
|
|
||||||
dedicated_server=false
|
|
||||||
custom_features=""
|
|
||||||
export_filter="all_resources"
|
|
||||||
include_filter=""
|
|
||||||
exclude_filter=""
|
|
||||||
export_path="exports/web/v0/index.html"
|
|
||||||
patches=PackedStringArray()
|
|
||||||
patch_delta_encoding=false
|
|
||||||
patch_delta_compression_level_zstd=19
|
|
||||||
patch_delta_min_reduction=0.1
|
|
||||||
patch_delta_include_filters="*"
|
|
||||||
patch_delta_exclude_filters=""
|
|
||||||
encryption_include_filters=""
|
|
||||||
encryption_exclude_filters=""
|
|
||||||
seed=0
|
|
||||||
encrypt_pck=false
|
|
||||||
encrypt_directory=false
|
|
||||||
script_export_mode=2
|
|
||||||
|
|
||||||
[preset.0.options]
|
|
||||||
|
|
||||||
custom_template/debug=""
|
|
||||||
custom_template/release=""
|
|
||||||
variant/extensions_support=false
|
|
||||||
variant/thread_support=false
|
|
||||||
vram_texture_compression/for_desktop=true
|
|
||||||
vram_texture_compression/for_mobile=false
|
|
||||||
html/export_icon=true
|
|
||||||
html/custom_html_shell=""
|
|
||||||
html/head_include=""
|
|
||||||
html/canvas_resize_policy=2
|
|
||||||
html/focus_canvas_on_start=true
|
|
||||||
html/experimental_virtual_keyboard=false
|
|
||||||
progressive_web_app/enabled=false
|
|
||||||
progressive_web_app/ensure_cross_origin_isolation_headers=true
|
|
||||||
progressive_web_app/offline_page=""
|
|
||||||
progressive_web_app/display=1
|
|
||||||
progressive_web_app/orientation=0
|
|
||||||
progressive_web_app/icon_144x144=""
|
|
||||||
progressive_web_app/icon_180x180=""
|
|
||||||
progressive_web_app/icon_512x512=""
|
|
||||||
progressive_web_app/background_color=Color(0, 0, 0, 1)
|
|
||||||
threads/emscripten_pool_size=8
|
|
||||||
threads/godot_pool_size=4
|
|
||||||
|
Before Width: | Height: | Size: 12 KiB |
@ -1,40 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://s3uvtu7ojkne"
|
|
||||||
path="res://.godot/imported/index.apple-touch-icon.png-2b4792069d5b356d62a457035bd91ae9.ctex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://exports/web/v0/index.apple-touch-icon.png"
|
|
||||||
dest_files=["res://.godot/imported/index.apple-touch-icon.png-2b4792069d5b356d62a457035bd91ae9.ctex"]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
compress/mode=0
|
|
||||||
compress/high_quality=false
|
|
||||||
compress/lossy_quality=0.7
|
|
||||||
compress/uastc_level=0
|
|
||||||
compress/rdo_quality_loss=0.0
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/normal_map=0
|
|
||||||
compress/channel_pack=0
|
|
||||||
mipmaps/generate=false
|
|
||||||
mipmaps/limit=-1
|
|
||||||
roughness/mode=0
|
|
||||||
roughness/src_normal=""
|
|
||||||
process/channel_remap/red=0
|
|
||||||
process/channel_remap/green=1
|
|
||||||
process/channel_remap/blue=2
|
|
||||||
process/channel_remap/alpha=3
|
|
||||||
process/fix_alpha_border=true
|
|
||||||
process/premult_alpha=false
|
|
||||||
process/normal_map_invert_y=false
|
|
||||||
process/hdr_as_srgb=false
|
|
||||||
process/hdr_clamp_exposure=false
|
|
||||||
process/size_limit=0
|
|
||||||
detect_3d/compress_to=1
|
|
||||||
@ -1,66 +0,0 @@
|
|||||||
/**************************************************************************/
|
|
||||||
/* 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);
|
|
||||||
@ -1,213 +0,0 @@
|
|||||||
/**************************************************************************/
|
|
||||||
/* audio.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 RingBuffer {
|
|
||||||
constructor(p_buffer, p_state, p_threads) {
|
|
||||||
this.buffer = p_buffer;
|
|
||||||
this.avail = p_state;
|
|
||||||
this.threads = p_threads;
|
|
||||||
this.rpos = 0;
|
|
||||||
this.wpos = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
data_left() {
|
|
||||||
return this.threads ? Atomics.load(this.avail, 0) : this.avail;
|
|
||||||
}
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
if (to_write) {
|
|
||||||
output.set(this.buffer.subarray(this.rpos, this.rpos + to_write), from);
|
|
||||||
}
|
|
||||||
this.rpos += to_write;
|
|
||||||
if (this.threads) {
|
|
||||||
Atomics.add(this.avail, 0, -output.length);
|
|
||||||
Atomics.notify(this.avail, 0);
|
|
||||||
} else {
|
|
||||||
this.avail -= output.length;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
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);
|
|
||||||
this.wpos += to_write;
|
|
||||||
if (mw === to_write) {
|
|
||||||
this.wpos = 0;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
const high = p_buffer.subarray(0, mw);
|
|
||||||
const low = p_buffer.subarray(mw);
|
|
||||||
this.buffer.set(high, this.wpos);
|
|
||||||
this.buffer.set(low);
|
|
||||||
this.wpos = low.length;
|
|
||||||
}
|
|
||||||
if (this.threads) {
|
|
||||||
Atomics.add(this.avail, 0, to_write);
|
|
||||||
Atomics.notify(this.avail, 0);
|
|
||||||
} else {
|
|
||||||
this.avail += to_write;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class GodotProcessor extends AudioWorkletProcessor {
|
|
||||||
constructor() {
|
|
||||||
super();
|
|
||||||
this.threads = false;
|
|
||||||
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() {
|
|
||||||
if (this.notifier) {
|
|
||||||
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.threads = true;
|
|
||||||
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, true);
|
|
||||||
this.output = new RingBuffer(p_data[2], avail_out, true);
|
|
||||||
} else if (p_cmd === 'stop') {
|
|
||||||
this.running = false;
|
|
||||||
this.output = null;
|
|
||||||
this.input = null;
|
|
||||||
this.lock = null;
|
|
||||||
this.notifier = null;
|
|
||||||
} else if (p_cmd === 'start_nothreads') {
|
|
||||||
this.output = new RingBuffer(p_data[0], p_data[0].length, false);
|
|
||||||
} else if (p_cmd === 'chunk') {
|
|
||||||
this.output.write(p_data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
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.threads) {
|
|
||||||
GodotProcessor.write_input(this.input_buffer, input);
|
|
||||||
this.port.postMessage({ 'cmd': 'input', 'data': this.input_buffer });
|
|
||||||
} else 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.'); // Uncomment this line to debug input buffer.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
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);
|
|
||||||
if (!this.threads) {
|
|
||||||
this.port.postMessage({ 'cmd': 'read', 'data': chunk });
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// this.port.postMessage('Output buffer has not enough frames! Skipping output frame.'); // Uncomment this line to debug output buffer.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
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);
|
|
||||||
@ -1,220 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0">
|
|
||||||
<title>trijam-365-movie-quote</title>
|
|
||||||
<style>
|
|
||||||
html, body, #canvas {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
border: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
body {
|
|
||||||
color: white;
|
|
||||||
background-color: black;
|
|
||||||
overflow: hidden;
|
|
||||||
touch-action: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
#canvas {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
#canvas:focus {
|
|
||||||
outline: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
#status, #status-splash, #status-progress {
|
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#status, #status-splash {
|
|
||||||
top: 0;
|
|
||||||
bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#status {
|
|
||||||
background-color: #242424;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
visibility: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
#status-splash {
|
|
||||||
max-height: 100%;
|
|
||||||
max-width: 100%;
|
|
||||||
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 {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
#status-progress {
|
|
||||||
bottom: 10%;
|
|
||||||
width: 50%;
|
|
||||||
margin: 0 auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
#status-notice {
|
|
||||||
background-color: #5b3943;
|
|
||||||
border-radius: 0.5rem;
|
|
||||||
border: 1px solid #9b3943;
|
|
||||||
color: #e0e0e0;
|
|
||||||
font-family: 'Noto Sans', 'Droid Sans', Arial, sans-serif;
|
|
||||||
line-height: 1.3;
|
|
||||||
margin: 0 2rem;
|
|
||||||
overflow: hidden;
|
|
||||||
padding: 1rem;
|
|
||||||
text-align: center;
|
|
||||||
z-index: 1;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<link id="-gd-engine-icon" rel="icon" type="image/png" href="index.icon.png" />
|
|
||||||
<link rel="apple-touch-icon" href="index.apple-touch-icon.png"/>
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<canvas id="canvas">
|
|
||||||
Your browser does not support the canvas tag.
|
|
||||||
</canvas>
|
|
||||||
|
|
||||||
<noscript>
|
|
||||||
Your browser does not support JavaScript.
|
|
||||||
</noscript>
|
|
||||||
|
|
||||||
<div id="status">
|
|
||||||
<img id="status-splash" class="show-image--true fullsize--true use-filter--true" src="index.png" alt="">
|
|
||||||
<progress id="status-progress"></progress>
|
|
||||||
<div id="status-notice"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script src="index.js"></script>
|
|
||||||
<script>
|
|
||||||
const GODOT_CONFIG = {"args":[],"canvasResizePolicy":2,"emscriptenPoolSize":8,"ensureCrossOriginIsolationHeaders":true,"executable":"index","experimentalVK":false,"fileSizes":{"index.pck":163985588,"index.wasm":37685705},"focusCanvas":true,"gdextensionLibs":[],"godotPoolSize":4};
|
|
||||||
const GODOT_THREADS_ENABLED = false;
|
|
||||||
const engine = new Engine(GODOT_CONFIG);
|
|
||||||
|
|
||||||
(function () {
|
|
||||||
const statusOverlay = document.getElementById('status');
|
|
||||||
const statusProgress = document.getElementById('status-progress');
|
|
||||||
const statusNotice = document.getElementById('status-notice');
|
|
||||||
|
|
||||||
let initializing = true;
|
|
||||||
let statusMode = '';
|
|
||||||
|
|
||||||
function setStatusMode(mode) {
|
|
||||||
if (statusMode === mode || !initializing) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (mode === 'hidden') {
|
|
||||||
statusOverlay.remove();
|
|
||||||
initializing = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
statusOverlay.style.visibility = 'visible';
|
|
||||||
statusProgress.style.display = mode === 'progress' ? 'block' : 'none';
|
|
||||||
statusNotice.style.display = mode === 'notice' ? 'block' : 'none';
|
|
||||||
statusMode = mode;
|
|
||||||
}
|
|
||||||
|
|
||||||
function setStatusNotice(text) {
|
|
||||||
while (statusNotice.lastChild) {
|
|
||||||
statusNotice.removeChild(statusNotice.lastChild);
|
|
||||||
}
|
|
||||||
const lines = text.split('\n');
|
|
||||||
lines.forEach((line) => {
|
|
||||||
statusNotice.appendChild(document.createTextNode(line));
|
|
||||||
statusNotice.appendChild(document.createElement('br'));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function displayFailureNotice(err) {
|
|
||||||
console.error(err);
|
|
||||||
if (err instanceof Error) {
|
|
||||||
setStatusNotice(err.message);
|
|
||||||
} else if (typeof err === 'string') {
|
|
||||||
setStatusNotice(err);
|
|
||||||
} else {
|
|
||||||
setStatusNotice('An unknown error occurred.');
|
|
||||||
}
|
|
||||||
setStatusMode('notice');
|
|
||||||
initializing = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
const missing = Engine.getMissingFeatures({
|
|
||||||
threads: GODOT_THREADS_ENABLED,
|
|
||||||
});
|
|
||||||
|
|
||||||
if (missing.length !== 0) {
|
|
||||||
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
|
|
||||||
Promise.race([
|
|
||||||
serviceWorkerRegistrationPromise.then((registration) => {
|
|
||||||
if (registration != null) {
|
|
||||||
return Promise.reject(new Error('Service worker already exists.'));
|
|
||||||
}
|
|
||||||
return registration;
|
|
||||||
}).then(() => engine.installServiceWorker()),
|
|
||||||
// For some reason, `getRegistration()` can stall
|
|
||||||
new Promise((resolve) => {
|
|
||||||
setTimeout(() => resolve(), 2000);
|
|
||||||
}),
|
|
||||||
]).then(() => {
|
|
||||||
// Reload if there was no error.
|
|
||||||
window.location.reload();
|
|
||||||
}).catch((err) => {
|
|
||||||
console.error('Error while registering service worker:', err);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
// Display the message as usual
|
|
||||||
const missingMsg = 'Error\nThe following features required to run Godot projects on the Web are missing:\n';
|
|
||||||
displayFailureNotice(missingMsg + missing.join('\n'));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
setStatusMode('progress');
|
|
||||||
engine.startGame({
|
|
||||||
'onProgress': function (current, total) {
|
|
||||||
if (current > 0 && total > 0) {
|
|
||||||
statusProgress.value = current;
|
|
||||||
statusProgress.max = total;
|
|
||||||
} else {
|
|
||||||
statusProgress.removeAttribute('value');
|
|
||||||
statusProgress.removeAttribute('max');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}).then(() => {
|
|
||||||
setStatusMode('hidden');
|
|
||||||
}, displayFailureNotice);
|
|
||||||
}
|
|
||||||
}());
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 5.6 KiB |
@ -1,40 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://b6yvw6lis0noe"
|
|
||||||
path="res://.godot/imported/index.icon.png-766d3ad5e2e36139a7c4dc32e05ace76.ctex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://exports/web/v0/index.icon.png"
|
|
||||||
dest_files=["res://.godot/imported/index.icon.png-766d3ad5e2e36139a7c4dc32e05ace76.ctex"]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
compress/mode=0
|
|
||||||
compress/high_quality=false
|
|
||||||
compress/lossy_quality=0.7
|
|
||||||
compress/uastc_level=0
|
|
||||||
compress/rdo_quality_loss=0.0
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/normal_map=0
|
|
||||||
compress/channel_pack=0
|
|
||||||
mipmaps/generate=false
|
|
||||||
mipmaps/limit=-1
|
|
||||||
roughness/mode=0
|
|
||||||
roughness/src_normal=""
|
|
||||||
process/channel_remap/red=0
|
|
||||||
process/channel_remap/green=1
|
|
||||||
process/channel_remap/blue=2
|
|
||||||
process/channel_remap/alpha=3
|
|
||||||
process/fix_alpha_border=true
|
|
||||||
process/premult_alpha=false
|
|
||||||
process/normal_map_invert_y=false
|
|
||||||
process/hdr_as_srgb=false
|
|
||||||
process/hdr_clamp_exposure=false
|
|
||||||
process/size_limit=0
|
|
||||||
detect_3d/compress_to=1
|
|
||||||
|
Before Width: | Height: | Size: 1.1 MiB |
@ -1,40 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://bk50813p61k6i"
|
|
||||||
path="res://.godot/imported/index.png-540a1d15a15688e0c42df1949b0276af.ctex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://exports/web/v0/index.png"
|
|
||||||
dest_files=["res://.godot/imported/index.png-540a1d15a15688e0c42df1949b0276af.ctex"]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
compress/mode=0
|
|
||||||
compress/high_quality=false
|
|
||||||
compress/lossy_quality=0.7
|
|
||||||
compress/uastc_level=0
|
|
||||||
compress/rdo_quality_loss=0.0
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/normal_map=0
|
|
||||||
compress/channel_pack=0
|
|
||||||
mipmaps/generate=false
|
|
||||||
mipmaps/limit=-1
|
|
||||||
roughness/mode=0
|
|
||||||
roughness/src_normal=""
|
|
||||||
process/channel_remap/red=0
|
|
||||||
process/channel_remap/green=1
|
|
||||||
process/channel_remap/blue=2
|
|
||||||
process/channel_remap/alpha=3
|
|
||||||
process/fix_alpha_border=true
|
|
||||||
process/premult_alpha=false
|
|
||||||
process/normal_map_invert_y=false
|
|
||||||
process/hdr_as_srgb=false
|
|
||||||
process/hdr_clamp_exposure=false
|
|
||||||
process/size_limit=0
|
|
||||||
detect_3d/compress_to=1
|
|
||||||
116
main_2d.tscn
@ -1,133 +1,31 @@
|
|||||||
[gd_scene format=3 uid="uid://m87tvwartvc6"]
|
[gd_scene format=3 uid="uid://m87tvwartvc6"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://ct16vr66fn58d" path="res://shark.tscn" id="1_a68s1"]
|
[ext_resource type="PackedScene" uid="uid://ct16vr66fn58d" path="res://shark.tscn" id="1_a68s1"]
|
||||||
[ext_resource type="PackedScene" uid="uid://drmwx05dw5d3c" path="res://boat.tscn" id="2_4l5f2"]
|
|
||||||
|
|
||||||
[sub_resource type="Gradient" id="Gradient_a68s1"]
|
|
||||||
colors = PackedColorArray(0.06666667, 0.06666667, 0.07058824, 1, 0.07058824, 0.6666667, 0.7764706, 1)
|
|
||||||
|
|
||||||
[sub_resource type="GradientTexture2D" id="GradientTexture2D_4l5f2"]
|
|
||||||
gradient = SubResource("Gradient_a68s1")
|
|
||||||
width = 3840
|
|
||||||
height = 2160
|
|
||||||
fill_from = Vector2(1, 1)
|
|
||||||
|
|
||||||
[sub_resource type="Gradient" id="Gradient_jmyjl"]
|
|
||||||
colors = PackedColorArray(0.3529412, 0.29803923, 0.4392157, 1, 0.897154, 0.4827388, 0.4083181, 1)
|
|
||||||
|
|
||||||
[sub_resource type="GradientTexture2D" id="GradientTexture2D_1hbw6"]
|
|
||||||
gradient = SubResource("Gradient_jmyjl")
|
|
||||||
width = 3840
|
|
||||||
height = 1080
|
|
||||||
fill_to = Vector2(0, 1)
|
|
||||||
|
|
||||||
[sub_resource type="Gradient" id="Gradient_4l5f2"]
|
[sub_resource type="Gradient" id="Gradient_4l5f2"]
|
||||||
interpolation_mode = 2
|
interpolation_mode = 2
|
||||||
colors = PackedColorArray(0, 0, 0, 0, 0.6392157, 0.8117647, 0.87058824, 0.06666667)
|
offsets = PackedFloat32Array(0.3008658, 0.66450214, 0.9805195)
|
||||||
|
colors = PackedColorArray(0.06666667, 0.06666667, 0.07058824, 1, 0.3529412, 0.29803923, 0.4392157, 1, 0.039215688, 0.48235294, 0.60784316, 1)
|
||||||
|
|
||||||
[sub_resource type="FastNoiseLite" id="FastNoiseLite_8hhxv"]
|
[sub_resource type="FastNoiseLite" id="FastNoiseLite_8hhxv"]
|
||||||
noise_type = 2
|
noise_type = 2
|
||||||
frequency = 0.005
|
domain_warp_enabled = true
|
||||||
fractal_octaves = 1
|
|
||||||
|
|
||||||
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_jmyjl"]
|
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_jmyjl"]
|
||||||
width = 3840
|
|
||||||
height = 2160
|
|
||||||
noise = SubResource("FastNoiseLite_8hhxv")
|
noise = SubResource("FastNoiseLite_8hhxv")
|
||||||
color_ramp = SubResource("Gradient_4l5f2")
|
color_ramp = SubResource("Gradient_4l5f2")
|
||||||
seamless = true
|
seamless = true
|
||||||
|
|
||||||
[sub_resource type="Gradient" id="Gradient_8hhxv"]
|
|
||||||
offsets = PackedFloat32Array(0.64718616, 0.95887446)
|
|
||||||
colors = PackedColorArray(0, 0, 0, 0, 0.5137255, 0.74509805, 0.72156864, 0.07058824)
|
|
||||||
|
|
||||||
[sub_resource type="FastNoiseLite" id="FastNoiseLite_jmyjl"]
|
|
||||||
|
|
||||||
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_a68s1"]
|
|
||||||
width = 2160
|
|
||||||
height = 2160
|
|
||||||
noise = SubResource("FastNoiseLite_jmyjl")
|
|
||||||
color_ramp = SubResource("Gradient_8hhxv")
|
|
||||||
seamless = true
|
|
||||||
|
|
||||||
[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_4l5f2"]
|
|
||||||
|
|
||||||
[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_a68s1"]
|
|
||||||
|
|
||||||
[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_8hhxv"]
|
|
||||||
|
|
||||||
[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_jmyjl"]
|
|
||||||
|
|
||||||
[node name="Main2D" type="Node2D" unique_id=1396228864]
|
[node name="Main2D" type="Node2D" unique_id=1396228864]
|
||||||
|
|
||||||
[node name="BackgroundLayer" type="Parallax2D" parent="." unique_id=1376556356]
|
[node name="BackgroundLayer" type="Parallax2D" parent="." unique_id=1376556356]
|
||||||
scroll_offset = Vector2(0, 1080)
|
repeat_size = Vector2(512, 512)
|
||||||
repeat_size = Vector2(3840, 0)
|
|
||||||
repeat_times = 10
|
|
||||||
|
|
||||||
[node name="OceanBackground" type="Sprite2D" parent="BackgroundLayer" unique_id=2137941191]
|
[node name="Sprite2D" type="Sprite2D" parent="BackgroundLayer" unique_id=2137941191]
|
||||||
texture = SubResource("GradientTexture2D_4l5f2")
|
|
||||||
|
|
||||||
[node name="SkyBackground" type="Sprite2D" parent="BackgroundLayer" unique_id=1592430551]
|
|
||||||
position = Vector2(0, -1620)
|
|
||||||
texture = SubResource("GradientTexture2D_1hbw6")
|
|
||||||
|
|
||||||
[node name="MidgroundLayer" type="Parallax2D" parent="." unique_id=2049755198]
|
|
||||||
scroll_offset = Vector2(0, 1080)
|
|
||||||
repeat_size = Vector2(3840, 0)
|
|
||||||
autoscroll = Vector2(-100, 0)
|
|
||||||
repeat_times = 10
|
|
||||||
|
|
||||||
[node name="Sprite2D" type="Sprite2D" parent="MidgroundLayer" unique_id=1680715438]
|
|
||||||
texture = SubResource("NoiseTexture2D_jmyjl")
|
texture = SubResource("NoiseTexture2D_jmyjl")
|
||||||
|
|
||||||
[node name="ForegroundLayer" type="Parallax2D" parent="." unique_id=603516260]
|
[node name="MidgroundLayer" type="Parallax2D" parent="." unique_id=2049755198]
|
||||||
z_index = 100
|
|
||||||
scroll_scale = Vector2(2, 1)
|
|
||||||
scroll_offset = Vector2(0, 1080)
|
|
||||||
repeat_size = Vector2(2160, 0)
|
|
||||||
autoscroll = Vector2(-200, 0)
|
|
||||||
repeat_times = 10
|
|
||||||
|
|
||||||
[node name="Sprite2D" type="Sprite2D" parent="ForegroundLayer" unique_id=904849640]
|
[node name="ForegroundLayer" type="Parallax2D" parent="." unique_id=603516260]
|
||||||
texture = SubResource("NoiseTexture2D_a68s1")
|
|
||||||
|
|
||||||
[node name="Shark" parent="." unique_id=868425079 instance=ExtResource("1_a68s1")]
|
[node name="Shark" parent="." unique_id=868425079 instance=ExtResource("1_a68s1")]
|
||||||
position = Vector2(0, 1080)
|
|
||||||
|
|
||||||
[node name="WaterLevel" type="StaticBody2D" parent="." unique_id=1297570319]
|
|
||||||
collision_layer = 4
|
|
||||||
collision_mask = 8
|
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="WaterLevel" unique_id=1033306709]
|
|
||||||
shape = SubResource("WorldBoundaryShape2D_4l5f2")
|
|
||||||
|
|
||||||
[node name="Boat" parent="." unique_id=441622829 instance=ExtResource("2_4l5f2")]
|
|
||||||
position = Vector2(0, -109)
|
|
||||||
movement_speed = 1000.0
|
|
||||||
|
|
||||||
[node name="Boundaries" type="Node" parent="." unique_id=406655667]
|
|
||||||
|
|
||||||
[node name="Bottom" type="StaticBody2D" parent="Boundaries" unique_id=1567577642]
|
|
||||||
position = Vector2(0, 2160)
|
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Boundaries/Bottom" unique_id=2143383673]
|
|
||||||
shape = SubResource("WorldBoundaryShape2D_a68s1")
|
|
||||||
|
|
||||||
[node name="Left" type="StaticBody2D" parent="Boundaries" unique_id=1447638927]
|
|
||||||
position = Vector2(-21000, 0)
|
|
||||||
collision_layer = 2
|
|
||||||
collision_mask = 9
|
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Boundaries/Left" unique_id=563328830]
|
|
||||||
rotation = 1.5707964
|
|
||||||
shape = SubResource("WorldBoundaryShape2D_8hhxv")
|
|
||||||
|
|
||||||
[node name="Right" type="StaticBody2D" parent="Boundaries" unique_id=1086854750]
|
|
||||||
position = Vector2(21000, 0)
|
|
||||||
collision_layer = 2
|
|
||||||
collision_mask = 9
|
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Boundaries/Right" unique_id=978843810]
|
|
||||||
rotation = -1.5707964
|
|
||||||
shape = SubResource("WorldBoundaryShape2D_jmyjl")
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 1.1 MiB |
@ -1,40 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://dlr08vnbmuua"
|
|
||||||
path="res://.godot/imported/bigger-boat-1080p.png-feecd7b092b603b1dd483721ecbb38de.ctex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://misc/bigger-boat-1080p.png"
|
|
||||||
dest_files=["res://.godot/imported/bigger-boat-1080p.png-feecd7b092b603b1dd483721ecbb38de.ctex"]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
compress/mode=0
|
|
||||||
compress/high_quality=false
|
|
||||||
compress/lossy_quality=0.7
|
|
||||||
compress/uastc_level=0
|
|
||||||
compress/rdo_quality_loss=0.0
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/normal_map=0
|
|
||||||
compress/channel_pack=0
|
|
||||||
mipmaps/generate=false
|
|
||||||
mipmaps/limit=-1
|
|
||||||
roughness/mode=0
|
|
||||||
roughness/src_normal=""
|
|
||||||
process/channel_remap/red=0
|
|
||||||
process/channel_remap/green=1
|
|
||||||
process/channel_remap/blue=2
|
|
||||||
process/channel_remap/alpha=3
|
|
||||||
process/fix_alpha_border=true
|
|
||||||
process/premult_alpha=false
|
|
||||||
process/normal_map_invert_y=false
|
|
||||||
process/hdr_as_srgb=false
|
|
||||||
process/hdr_clamp_exposure=false
|
|
||||||
process/size_limit=0
|
|
||||||
detect_3d/compress_to=1
|
|
||||||
@ -11,16 +11,9 @@ config_version=5
|
|||||||
[application]
|
[application]
|
||||||
|
|
||||||
config/name="trijam-365-movie-quote"
|
config/name="trijam-365-movie-quote"
|
||||||
run/main_scene="uid://m87tvwartvc6"
|
|
||||||
config/features=PackedStringArray("4.6", "GL Compatibility")
|
config/features=PackedStringArray("4.6", "GL Compatibility")
|
||||||
boot_splash/image="uid://dlr08vnbmuua"
|
|
||||||
config/icon="res://icon.svg"
|
config/icon="res://icon.svg"
|
||||||
|
|
||||||
[display]
|
|
||||||
|
|
||||||
window/size/viewport_width=1920
|
|
||||||
window/size/viewport_height=1080
|
|
||||||
|
|
||||||
[input]
|
[input]
|
||||||
|
|
||||||
up={
|
up={
|
||||||
@ -54,13 +47,6 @@ swim={
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
[layer_names]
|
|
||||||
|
|
||||||
2d_physics/layer_1="player"
|
|
||||||
2d_physics/layer_2="boundaries"
|
|
||||||
2d_physics/layer_3="water_level"
|
|
||||||
2d_physics/layer_4="boats"
|
|
||||||
|
|
||||||
[physics]
|
[physics]
|
||||||
|
|
||||||
3d/physics_engine="Jolt Physics"
|
3d/physics_engine="Jolt Physics"
|
||||||
|
|||||||
67
shark.gd
@ -1,31 +1,27 @@
|
|||||||
#@tool
|
#@tool
|
||||||
#@icon(icon_path: String)
|
#@icon(icon_path: String)
|
||||||
#class_name MyNode
|
#class_name MyNode
|
||||||
extends RigidBody2D
|
extends CharacterBody2D
|
||||||
## Documentation comments
|
## Documentation comments
|
||||||
|
|
||||||
#signal
|
#signal
|
||||||
enum State {IDLE, SWIM, BITE}
|
enum FaceDirection {LEFT, RIGHT}
|
||||||
|
#const
|
||||||
const WATER_LEVEL: float = 0.0
|
|
||||||
|
|
||||||
@export_range(0, 360, 1.0, "radians_as_degrees") var rotation_speed: float = 0.0 ## degrees per second
|
@export_range(0, 360, 1.0, "radians_as_degrees") var rotation_speed: float = 0.0 ## degrees per second
|
||||||
@export var swim_power: float = 100.0
|
|
||||||
|
|
||||||
var altitude: float = 0.0
|
|
||||||
var current_state: State = State.IDLE: set = set_state
|
|
||||||
var input_vector: Vector2
|
var input_vector: Vector2
|
||||||
var facing_right: bool = true: set = set_facing_right
|
var facing_right: bool = true: set = set_facing_right
|
||||||
var tilt: float = 0.0
|
var tilt: float = 0.0
|
||||||
|
var tilt_power: float = 0.0
|
||||||
|
|
||||||
@onready var shark_sprite: AnimatedSprite2D = $SharkSprite
|
@onready var shark_sprite: AnimatedSprite2D = $SharkSprite
|
||||||
@onready var shark_collider: CollisionShape2D = $SharkCollider
|
@onready var shark_collider: CollisionShape2D = $SharkCollider
|
||||||
#@onready var shark_cam: Camera2D = $SharkCam
|
@onready var shark_cam: Camera2D = $SharkCam
|
||||||
|
|
||||||
## OVERRIDES
|
## OVERRIDES
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
_connect_signals()
|
pass
|
||||||
|
|
||||||
func _process(_delta: float) -> void:
|
func _process(_delta: float) -> void:
|
||||||
if facing_right:
|
if facing_right:
|
||||||
@ -34,41 +30,6 @@ func _process(_delta: float) -> void:
|
|||||||
tilt = -clamp(rotation, -1.0, 1.0)
|
tilt = -clamp(rotation, -1.0, 1.0)
|
||||||
|
|
||||||
func _physics_process(delta: float) -> void:
|
func _physics_process(delta: float) -> void:
|
||||||
_handle_movement(delta)
|
|
||||||
if Input.is_action_just_pressed("swim"):
|
|
||||||
_swim()
|
|
||||||
if Input.is_action_just_pressed("bite"):
|
|
||||||
_bite()
|
|
||||||
if global_position.y < WATER_LEVEL:
|
|
||||||
_apply_gravity()
|
|
||||||
else:
|
|
||||||
altitude = 0.0
|
|
||||||
gravity_scale = 0.01
|
|
||||||
|
|
||||||
## CORE
|
|
||||||
func _bite() -> void:
|
|
||||||
current_state = State.BITE
|
|
||||||
_apply_swimpulse()
|
|
||||||
|
|
||||||
func _swim() -> void:
|
|
||||||
current_state = State.SWIM
|
|
||||||
_apply_swimpulse()
|
|
||||||
|
|
||||||
## PRIVATE/HELPER
|
|
||||||
func _apply_gravity() -> void:
|
|
||||||
altitude = -global_position.y
|
|
||||||
gravity_scale = 0.01 * altitude
|
|
||||||
|
|
||||||
func _apply_swimpulse() -> void:
|
|
||||||
if facing_right:
|
|
||||||
apply_central_impulse(Vector2(1.0, tilt).normalized() * swim_power)
|
|
||||||
else:
|
|
||||||
apply_central_impulse(Vector2(-1.0, tilt).normalized() * swim_power)
|
|
||||||
|
|
||||||
func _connect_signals() -> void:
|
|
||||||
shark_sprite.connect("animation_finished", on_animation_finished)
|
|
||||||
|
|
||||||
func _handle_movement(delta: float) -> void:
|
|
||||||
# handle left-right movement
|
# handle left-right movement
|
||||||
input_vector.x = Input.get_axis("left", "right")
|
input_vector.x = Input.get_axis("left", "right")
|
||||||
# flip sprite if needed
|
# flip sprite if needed
|
||||||
@ -96,9 +57,11 @@ func _handle_movement(delta: float) -> void:
|
|||||||
rotate(-rotation_speed * delta)
|
rotate(-rotation_speed * delta)
|
||||||
|
|
||||||
|
|
||||||
|
## CORE
|
||||||
|
|
||||||
|
## PRIVATE/HELPER
|
||||||
|
|
||||||
## RECEIVERS
|
## RECEIVERS
|
||||||
func on_animation_finished() -> void:
|
|
||||||
current_state = State.IDLE
|
|
||||||
|
|
||||||
## SETTERS/GETTERS
|
## SETTERS/GETTERS
|
||||||
func set_facing_right(is_facing_right: bool) -> void:
|
func set_facing_right(is_facing_right: bool) -> void:
|
||||||
@ -109,12 +72,4 @@ func set_facing_right(is_facing_right: bool) -> void:
|
|||||||
else:
|
else:
|
||||||
shark_sprite.flip_h = false
|
shark_sprite.flip_h = false
|
||||||
facing_right = is_facing_right
|
facing_right = is_facing_right
|
||||||
|
|
||||||
func set_state(new_state: State) -> void:
|
|
||||||
match new_state:
|
|
||||||
State.IDLE:
|
|
||||||
shark_sprite.play("idle")
|
|
||||||
State.SWIM:
|
|
||||||
shark_sprite.play("swim")
|
|
||||||
State.BITE:
|
|
||||||
shark_sprite.play("bite")
|
|
||||||
|
|||||||
21
shark.tscn
@ -327,7 +327,7 @@ animations = [{
|
|||||||
"duration": 1.0,
|
"duration": 1.0,
|
||||||
"texture": SubResource("AtlasTexture_ax117")
|
"texture": SubResource("AtlasTexture_ax117")
|
||||||
}],
|
}],
|
||||||
"loop": false,
|
"loop": true,
|
||||||
"name": &"swim",
|
"name": &"swim",
|
||||||
"speed": 24.0
|
"speed": 24.0
|
||||||
}]
|
}]
|
||||||
@ -336,34 +336,27 @@ animations = [{
|
|||||||
radius = 100.0
|
radius = 100.0
|
||||||
height = 500.0
|
height = 500.0
|
||||||
|
|
||||||
[node name="Shark" type="RigidBody2D" unique_id=1655095595]
|
[node name="Shark" type="CharacterBody2D" unique_id=868425079]
|
||||||
z_index = 10
|
|
||||||
gravity_scale = 0.01
|
|
||||||
script = ExtResource("1_uce6o")
|
script = ExtResource("1_uce6o")
|
||||||
rotation_speed = 1.5707963267948966
|
rotation_speed = 1.5707963267948966
|
||||||
|
|
||||||
[node name="SharkSprite" type="AnimatedSprite2D" parent="." unique_id=1862357568]
|
[node name="SharkSprite" type="AnimatedSprite2D" parent="." unique_id=1862357568]
|
||||||
sprite_frames = SubResource("SpriteFrames_odtda")
|
sprite_frames = SubResource("SpriteFrames_odtda")
|
||||||
animation = &"swim"
|
animation = &"bite"
|
||||||
autoplay = "idle"
|
autoplay = "idle"
|
||||||
flip_h = true
|
flip_h = true
|
||||||
|
|
||||||
[node name="SharkCam" type="Camera2D" parent="." unique_id=692363117]
|
[node name="SharkCam" type="Camera2D" parent="." unique_id=692363117]
|
||||||
zoom = Vector2(0.333, 0.333)
|
|
||||||
limit_left = -21000
|
|
||||||
limit_top = -1080
|
|
||||||
limit_right = 21000
|
|
||||||
limit_bottom = 2160
|
|
||||||
drag_horizontal_enabled = true
|
|
||||||
editor_draw_limits = true
|
|
||||||
|
|
||||||
[node name="SharkCollider" type="CollisionShape2D" parent="." unique_id=1437907772]
|
[node name="SharkCollider" type="CollisionShape2D" parent="." unique_id=1437907772]
|
||||||
rotation = 1.5707964
|
rotation = 1.5707964
|
||||||
shape = SubResource("CapsuleShape2D_uce6o")
|
shape = SubResource("CapsuleShape2D_uce6o")
|
||||||
|
|
||||||
|
[node name="RayCast2D" type="RayCast2D" parent="." unique_id=1636588841]
|
||||||
|
target_position = Vector2(500, 0)
|
||||||
|
|
||||||
[node name="SharkDebugLayer" type="CanvasLayer" parent="." unique_id=359221405]
|
[node name="SharkDebugLayer" type="CanvasLayer" parent="." unique_id=359221405]
|
||||||
visible = false
|
|
||||||
|
|
||||||
[node name="DebugSection" parent="SharkDebugLayer" unique_id=305062788 node_paths=PackedStringArray("target_node") instance=ExtResource("5_l26on")]
|
[node name="DebugSection" parent="SharkDebugLayer" unique_id=305062788 node_paths=PackedStringArray("target_node") instance=ExtResource("5_l26on")]
|
||||||
target_node = NodePath("../..")
|
target_node = NodePath("../..")
|
||||||
variables_to_track = Array[StringName]([&"input_vector", &"facing_right", &"tilt", &"gravity_scale", &"rotation", &"linear_velocity", &"global_position", &"altitude"])
|
variables_to_track = Array[StringName]([&"input_vector", &"facing_right", &"tilt", &"rotation_speed", &"rotation"])
|
||||||
|
|||||||
BIN
sprites/blue.png
|
Before Width: | Height: | Size: 244 KiB |
@ -1,40 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://yai2aniw0qk1"
|
|
||||||
path="res://.godot/imported/blue.png-12b76ed1cac07a8614fed55e35d68b1b.ctex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://sprites/blue.png"
|
|
||||||
dest_files=["res://.godot/imported/blue.png-12b76ed1cac07a8614fed55e35d68b1b.ctex"]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
compress/mode=0
|
|
||||||
compress/high_quality=false
|
|
||||||
compress/lossy_quality=0.7
|
|
||||||
compress/uastc_level=0
|
|
||||||
compress/rdo_quality_loss=0.0
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/normal_map=0
|
|
||||||
compress/channel_pack=0
|
|
||||||
mipmaps/generate=false
|
|
||||||
mipmaps/limit=-1
|
|
||||||
roughness/mode=0
|
|
||||||
roughness/src_normal=""
|
|
||||||
process/channel_remap/red=0
|
|
||||||
process/channel_remap/green=1
|
|
||||||
process/channel_remap/blue=2
|
|
||||||
process/channel_remap/alpha=3
|
|
||||||
process/fix_alpha_border=true
|
|
||||||
process/premult_alpha=false
|
|
||||||
process/normal_map_invert_y=false
|
|
||||||
process/hdr_as_srgb=false
|
|
||||||
process/hdr_clamp_exposure=false
|
|
||||||
process/size_limit=0
|
|
||||||
detect_3d/compress_to=1
|
|
||||||
|
Before Width: | Height: | Size: 237 KiB |
@ -1,40 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://ch6ln0yerieih"
|
|
||||||
path="res://.godot/imported/green-orange.png-fb0f5a83648c3627af38c74ed4d2fc0c.ctex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://sprites/green-orange.png"
|
|
||||||
dest_files=["res://.godot/imported/green-orange.png-fb0f5a83648c3627af38c74ed4d2fc0c.ctex"]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
compress/mode=0
|
|
||||||
compress/high_quality=false
|
|
||||||
compress/lossy_quality=0.7
|
|
||||||
compress/uastc_level=0
|
|
||||||
compress/rdo_quality_loss=0.0
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/normal_map=0
|
|
||||||
compress/channel_pack=0
|
|
||||||
mipmaps/generate=false
|
|
||||||
mipmaps/limit=-1
|
|
||||||
roughness/mode=0
|
|
||||||
roughness/src_normal=""
|
|
||||||
process/channel_remap/red=0
|
|
||||||
process/channel_remap/green=1
|
|
||||||
process/channel_remap/blue=2
|
|
||||||
process/channel_remap/alpha=3
|
|
||||||
process/fix_alpha_border=true
|
|
||||||
process/premult_alpha=false
|
|
||||||
process/normal_map_invert_y=false
|
|
||||||
process/hdr_as_srgb=false
|
|
||||||
process/hdr_clamp_exposure=false
|
|
||||||
process/size_limit=0
|
|
||||||
detect_3d/compress_to=1
|
|
||||||
|
Before Width: | Height: | Size: 250 KiB |
@ -1,40 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://bdot1ynvwgy1e"
|
|
||||||
path="res://.godot/imported/green.png-656e452538eec42f12fdd2fccb1b1800.ctex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://sprites/green.png"
|
|
||||||
dest_files=["res://.godot/imported/green.png-656e452538eec42f12fdd2fccb1b1800.ctex"]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
compress/mode=0
|
|
||||||
compress/high_quality=false
|
|
||||||
compress/lossy_quality=0.7
|
|
||||||
compress/uastc_level=0
|
|
||||||
compress/rdo_quality_loss=0.0
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/normal_map=0
|
|
||||||
compress/channel_pack=0
|
|
||||||
mipmaps/generate=false
|
|
||||||
mipmaps/limit=-1
|
|
||||||
roughness/mode=0
|
|
||||||
roughness/src_normal=""
|
|
||||||
process/channel_remap/red=0
|
|
||||||
process/channel_remap/green=1
|
|
||||||
process/channel_remap/blue=2
|
|
||||||
process/channel_remap/alpha=3
|
|
||||||
process/fix_alpha_border=true
|
|
||||||
process/premult_alpha=false
|
|
||||||
process/normal_map_invert_y=false
|
|
||||||
process/hdr_as_srgb=false
|
|
||||||
process/hdr_clamp_exposure=false
|
|
||||||
process/size_limit=0
|
|
||||||
detect_3d/compress_to=1
|
|
||||||
|
Before Width: | Height: | Size: 232 KiB |
@ -1,40 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://bibif5edtqpi4"
|
|
||||||
path="res://.godot/imported/purple.png-844a0d700820f7245b6d600a65da611a.ctex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://sprites/purple.png"
|
|
||||||
dest_files=["res://.godot/imported/purple.png-844a0d700820f7245b6d600a65da611a.ctex"]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
compress/mode=0
|
|
||||||
compress/high_quality=false
|
|
||||||
compress/lossy_quality=0.7
|
|
||||||
compress/uastc_level=0
|
|
||||||
compress/rdo_quality_loss=0.0
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/normal_map=0
|
|
||||||
compress/channel_pack=0
|
|
||||||
mipmaps/generate=false
|
|
||||||
mipmaps/limit=-1
|
|
||||||
roughness/mode=0
|
|
||||||
roughness/src_normal=""
|
|
||||||
process/channel_remap/red=0
|
|
||||||
process/channel_remap/green=1
|
|
||||||
process/channel_remap/blue=2
|
|
||||||
process/channel_remap/alpha=3
|
|
||||||
process/fix_alpha_border=true
|
|
||||||
process/premult_alpha=false
|
|
||||||
process/normal_map_invert_y=false
|
|
||||||
process/hdr_as_srgb=false
|
|
||||||
process/hdr_clamp_exposure=false
|
|
||||||
process/size_limit=0
|
|
||||||
detect_3d/compress_to=1
|
|
||||||
BIN
sprites/red.png
|
Before Width: | Height: | Size: 221 KiB |
@ -1,40 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://iiyslw33af84"
|
|
||||||
path="res://.godot/imported/red.png-05b3228fc2d1b95d5876cdf9be510c01.ctex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://sprites/red.png"
|
|
||||||
dest_files=["res://.godot/imported/red.png-05b3228fc2d1b95d5876cdf9be510c01.ctex"]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
compress/mode=0
|
|
||||||
compress/high_quality=false
|
|
||||||
compress/lossy_quality=0.7
|
|
||||||
compress/uastc_level=0
|
|
||||||
compress/rdo_quality_loss=0.0
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/normal_map=0
|
|
||||||
compress/channel_pack=0
|
|
||||||
mipmaps/generate=false
|
|
||||||
mipmaps/limit=-1
|
|
||||||
roughness/mode=0
|
|
||||||
roughness/src_normal=""
|
|
||||||
process/channel_remap/red=0
|
|
||||||
process/channel_remap/green=1
|
|
||||||
process/channel_remap/blue=2
|
|
||||||
process/channel_remap/alpha=3
|
|
||||||
process/fix_alpha_border=true
|
|
||||||
process/premult_alpha=false
|
|
||||||
process/normal_map_invert_y=false
|
|
||||||
process/hdr_as_srgb=false
|
|
||||||
process/hdr_clamp_exposure=false
|
|
||||||
process/size_limit=0
|
|
||||||
detect_3d/compress_to=1
|
|
||||||
|
Before Width: | Height: | Size: 226 KiB |
@ -1,40 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://ceiehilleoqyy"
|
|
||||||
path="res://.godot/imported/yellow.png-334014744dabb6f115a5c37377da0f22.ctex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://sprites/yellow.png"
|
|
||||||
dest_files=["res://.godot/imported/yellow.png-334014744dabb6f115a5c37377da0f22.ctex"]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
compress/mode=0
|
|
||||||
compress/high_quality=false
|
|
||||||
compress/lossy_quality=0.7
|
|
||||||
compress/uastc_level=0
|
|
||||||
compress/rdo_quality_loss=0.0
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/normal_map=0
|
|
||||||
compress/channel_pack=0
|
|
||||||
mipmaps/generate=false
|
|
||||||
mipmaps/limit=-1
|
|
||||||
roughness/mode=0
|
|
||||||
roughness/src_normal=""
|
|
||||||
process/channel_remap/red=0
|
|
||||||
process/channel_remap/green=1
|
|
||||||
process/channel_remap/blue=2
|
|
||||||
process/channel_remap/alpha=3
|
|
||||||
process/fix_alpha_border=true
|
|
||||||
process/premult_alpha=false
|
|
||||||
process/normal_map_invert_y=false
|
|
||||||
process/hdr_as_srgb=false
|
|
||||||
process/hdr_clamp_exposure=false
|
|
||||||
process/size_limit=0
|
|
||||||
detect_3d/compress_to=1
|
|
||||||