Cleanup commit

This commit is contained in:
oitsjustjose 2025-09-26 12:43:48 -05:00
commit e599032a77
50 changed files with 1454 additions and 35 deletions

View file

@ -0,0 +1,3 @@
source_md5="7e41bf3051b18e392a4bb6c0cc45cd7c"
dest_md5="027d7cfe7c7f2d473caf37960292caa5"

View file

@ -0,0 +1,3 @@
source_md5="7e41bf3051b18e392a4bb6c0cc45cd7c"
dest_md5="027d7cfe7c7f2d473caf37960292caa5"

View file

@ -1,3 +1,3 @@
source_md5="ef66f4604a36137ec15042aeccdf9bf1"
dest_md5="c332a47a8e2362505e82b4ff3bb3310c"
dest_md5="8b91976debb4315c0c7af5ff156f9fe5"

View file

@ -1,3 +1,3 @@
source_md5="856accd9a5711ac6c1318e1d4c4fe810"
dest_md5="b08dbe476a9d6d71e667240c31408684"
dest_md5="a4b7c53d0523aecc9247ac511945ec1d"

View file

@ -1,3 +1,3 @@
source_md5="11269565bdc8cf5767feba8a631a4c55"
dest_md5="6cb4d1bec2fb3b59eef743835f2c78b7"
dest_md5="34e6b416924bb4045dc6520c42d2aa77"

View file

@ -1,3 +1,3 @@
source_md5="92133f7c1a904dfb7221b207c491ef7a"
dest_md5="0068d1584efea480a3b384ff3c699f6a"
dest_md5="edccec359e18c46970f687863b2dcac2"

View file

@ -1,3 +1,3 @@
source_md5="61e9016f4564dbbc88be1b58798d3e5c"
dest_md5="e712026e5768bf59e7e9694aa8fa54e0"
dest_md5="3fc95adc96101edeaa4ed290a28c8446"

View file

@ -1,3 +1,3 @@
source_md5="6f63afc740d304b42a7a3afe73353da2"
dest_md5="6d3f21e1d8ce70f61596eb72b2a6d4bf"
dest_md5="f4d441a2702d4aa8a55ad4e2030358b6"

View file

@ -1,3 +1,3 @@
source_md5="246ea51adb6ad2e318ee5e693a8bddab"
dest_md5="3b05e9e5308b7fa0a9ca5ec074604c9f"
dest_md5="2d823bc94d8bf13ebbabbdddb623c316"

View file

@ -1,3 +1,3 @@
source_md5="526df41c5f218232c8d8404a9687378a"
dest_md5="263fc3a99f956daa3627934d3782db52"
dest_md5="2ed6c5a591d62f733b7c3bec5ba2a9c9"

View file

@ -0,0 +1,3 @@
source_md5="c0dc23ccdb5def75c5276c4ee8661b19"
dest_md5="5488a35b8a9531f3c3419fee1644d9a7"

View file

@ -0,0 +1,3 @@
source_md5="c0dc23ccdb5def75c5276c4ee8661b19"
dest_md5="5488a35b8a9531f3c3419fee1644d9a7"

30
assets/anim/Eustice.tres Normal file
View file

@ -0,0 +1,30 @@
[gd_resource type="AnimatedTexture" load_steps=9 format=2]
[ext_resource path="res://assets/frames/big_demon_run_anim_f3.png" type="Texture" id=1]
[ext_resource path="res://assets/frames/big_demon_run_anim_f0.png" type="Texture" id=2]
[ext_resource path="res://assets/frames/big_demon_run_anim_f1.png" type="Texture" id=3]
[ext_resource path="res://assets/frames/big_demon_idle_anim_f3.png" type="Texture" id=4]
[ext_resource path="res://assets/frames/big_demon_run_anim_f2.png" type="Texture" id=5]
[ext_resource path="res://assets/frames/big_demon_idle_anim_f2.png" type="Texture" id=6]
[ext_resource path="res://assets/frames/big_demon_idle_anim_f1.png" type="Texture" id=7]
[ext_resource path="res://assets/frames/big_demon_idle_anim_f0.png" type="Texture" id=8]
[resource]
resource_local_to_scene = true
frames = 8
fps = 8.0
frame_0/texture = ExtResource( 8 )
frame_1/texture = ExtResource( 7 )
frame_1/delay_sec = 0.0
frame_2/texture = ExtResource( 6 )
frame_2/delay_sec = 0.0
frame_3/texture = ExtResource( 4 )
frame_3/delay_sec = 0.0
frame_4/texture = ExtResource( 2 )
frame_4/delay_sec = 0.0
frame_5/texture = ExtResource( 3 )
frame_5/delay_sec = 0.0
frame_6/texture = ExtResource( 5 )
frame_6/delay_sec = 0.0
frame_7/texture = ExtResource( 1 )
frame_7/delay_sec = 0.0

View file

@ -20,7 +20,7 @@ compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2

View file

@ -20,7 +20,7 @@ compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2

View file

@ -20,7 +20,7 @@ compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2

View file

@ -20,7 +20,7 @@ compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2

View file

@ -20,7 +20,7 @@ compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2

View file

@ -20,7 +20,7 @@ compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2

View file

@ -20,7 +20,7 @@ compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2

View file

@ -20,7 +20,7 @@ compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2

186
dist/Crawl n Brawl 2.audio.worklet.js vendored Normal file
View file

@ -0,0 +1,186 @@
/*************************************************************************/
/* audio.worklet.js */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2021 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);

246
dist/Crawl n Brawl 2.html vendored Normal file
View file

@ -0,0 +1,246 @@
<!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>Crawl n Brawl 2</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='Crawl n Brawl 2.js'></script>
<script type='text/javascript'>//<![CDATA[
const GODOT_CONFIG = {"args":[],"canvasResizePolicy":2,"executable":"Crawl n Brawl 2","experimentalVK":false,"fileSizes":{"Crawl n Brawl 2.pck":1542512,"Crawl n Brawl 2.wasm":18140456},"gdnativeLibs":[]};
var engine = new Engine(GODOT_CONFIG);
(function() {
const INDETERMINATE_STATUS_STEP_MS = 100;
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 animationCallbacks = [];
function animate(time) {
animationCallbacks.forEach(callback => callback(time));
requestAnimationFrame(animate);
}
requestAnimationFrame(animate);
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';
}
}
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'));
});
};
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.startGame({
'onProgress': function (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');
}
},
}).then(() => {
setStatusMode('hidden');
initializing = false;
}, displayFailureNotice);
}
})();
//]]></script>
</body>
</html>

772
dist/Crawl n Brawl 2.js vendored Normal file

File diff suppressed because one or more lines are too long

BIN
dist/Crawl n Brawl 2.pck vendored Normal file

Binary file not shown.

BIN
dist/Crawl n Brawl 2.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

34
dist/Crawl n Brawl 2.png.import vendored Normal file
View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/Crawl n Brawl 2.png-25bd8f6149c15d25547458e39c1be42f.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://dist/Crawl n Brawl 2.png"
dest_files=[ "res://.import/Crawl n Brawl 2.png-25bd8f6149c15d25547458e39c1be42f.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=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

BIN
dist/Crawl n Brawl 2.wasm vendored Normal file

Binary file not shown.

BIN
dist/asdf.zip vendored Normal file

Binary file not shown.

BIN
dist/favicon.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 706 B

34
dist/favicon.png.import vendored Normal file
View file

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

24
export_presets.cfg Normal file
View file

@ -0,0 +1,24 @@
[preset.0]
name="HTML5"
platform="HTML5"
runnable=true
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="dist/Crawl n Brawl 2.html"
script_export_mode=1
script_encryption_key=""
[preset.0.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/canvas_resize_policy=2
html/experimental_virtual_keyboard=false

View file

@ -45,12 +45,10 @@ func _ready():
rand.randf_range(0.0, 1.0)
)
print("Picked color (%s %s %s)" % [LevelCol.r, LevelCol.g, LevelCol.b])
bg.modulate = LevelCol
for deco in decorations:
var texture = possible_decos[rand.randi_range(0 ,len(possible_decos))]
var texture = possible_decos[rand.randi_range(0, len(possible_decos))-1]
var x = smart_snap(rand.randi_range(0, 1024), 64, 1024)
var y = smart_snap(rand.randi_range(0, 600), 64, 600)
deco.set_texture(texture)

View file

@ -1,10 +1,11 @@
[gd_scene load_steps=6 format=2]
[gd_scene load_steps=7 format=2]
[ext_resource path="res://scene/level/Background.tscn" type="PackedScene" id=1]
[ext_resource path="res://scene/entity/player/Player.tscn" type="PackedScene" id=2]
[ext_resource path="res://scene/entity/player/Movement.gd" type="Script" id=3]
[ext_resource path="res://scene/Level.gd" type="Script" id=4]
[ext_resource path="res://scene/level/Boundary.tscn" type="PackedScene" id=5]
[ext_resource path="res://scene/entity/enemy/Eustice.tscn" type="PackedScene" id=6]
[node name="Level" type="Node2D"]
script = ExtResource( 4 )
@ -16,7 +17,7 @@ position = Vector2( 0.839233, 0.839233 )
z_index = -4096
[node name="Player" parent="." instance=ExtResource( 2 )]
position = Vector2( 36.3647, 552.945 )
position = Vector2( 48.3647, 544.945 )
scale = Vector2( 4, 4 )
script = ExtResource( 3 )
@ -28,3 +29,6 @@ z_index = -64
[node name="Deco3" type="Sprite" parent="."]
z_index = -64
[node name="Monster" parent="." instance=ExtResource( 6 )]
position = Vector2( 678, 524 )

View file

@ -0,0 +1,48 @@
extends KinematicBody2D
export(float) var move_speed = 500
export(float) var gravity = 100
onready var sprite = get_node("Sprite")
onready var bbox = get_node("CollisionShape2D")
onready var sounds = get_node("AudioStream")
onready var lvl_size = get_viewport().get_visible_rect().size
var rand: RandomNumberGenerator
var vel: Vector2 = Vector2(1.0, 0)
var dir: float = 1.0
var facing_left: bool = false
func _ready():
# RNG Selection
rand = RandomNumberGenerator.new()
rand.seed = hash(OS.get_time())
#if rand.randi_range(0, 1) == 1:
# vel = Vector2(-1.0, 0)
# facing_left = true
# Other resources -- this will need to be updated for mainhand as well
# TODO: Noises per-monster should be impl'd
# var JumpSound = preload('res://assets/sounds/player_jump.wav')
func _physics_process(_delta):
var next_move: Vector2 = vel
var axis = self.position
var width = bbox.shape.extents.x
if axis.x + width >= (lvl_size.x):
facing_left = true
sprite.set_flip_h( facing_left )
dir = -1.0
# 2 is sort of arbitrary I think?
elif axis.x - width <= 2:
facing_left = false
sprite.set_flip_h( facing_left )
dir = 1.0
next_move.x = dir * move_speed
next_move.y += gravity
vel = move_and_slide_with_snap(next_move, Vector2.DOWN, Vector2.UP)

View file

@ -0,0 +1,20 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://assets/anim/Eustice.tres" type="Texture" id=1]
[ext_resource path="res://scene/entity/enemy/Eustice.gd" type="Script" id=2]
[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 39.6152, 67.682 )
[node name="Node2D" type="KinematicBody2D"]
script = ExtResource( 2 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource( 1 )
[node name="Sprite" type="Sprite" parent="."]
position = Vector2( 0.26215, -3.81124 )
scale = Vector2( 4, 4 )
texture = ExtResource( 1 )
[node name="AudioStream" type="AudioStreamPlayer2D" parent="."]

View file

@ -1,24 +1,24 @@
extends KinematicBody2D
var weapons = {
"anime_sword": load("res://assets/weapons/weapon_anime_sword.png"),
"axe": load("res://assets/weapons/weapon_axe.png"),
"baton_with_spikes": load("res://assets/weapons/weapon_baton_with_spikes.png"),
"big_hammer": load("res://assets/weapons/weapon_big_hammer.png"),
"cleaver": load("res://assets/weapons/weapon_cleaver.png"),
"anime_sword": load("res://assets/weapons/weapon_anime_sword.png"),
"axe": load("res://assets/weapons/weapon_axe.png"),
"baton_with_spikes": load("res://assets/weapons/weapon_baton_with_spikes.png"),
"big_hammer": load("res://assets/weapons/weapon_big_hammer.png"),
"cleaver": load("res://assets/weapons/weapon_cleaver.png"),
"golden_sword": load("res://assets/weapons/weapon_golden_sword.png"),
"hammer": load("res://assets/weapons/weapon_hammer.png"),
"katana": load("res://assets/weapons/weapon_katana.png"),
"knife": load("res://assets/weapons/weapon_knife.png"),
"hammer": load("res://assets/weapons/weapon_hammer.png"),
"katana": load("res://assets/weapons/weapon_katana.png"),
"knife": load("res://assets/weapons/weapon_knife.png"),
"knight_sword": load("res://assets/weapons/weapon_knight_sword.png"),
"lavish_sword": load("res://assets/weapons/weapon_lavish_sword.png"),
"mace": load("res://assets/weapons/weapon_mace.png"),
"machete": load("res://assets/weapons/weapon_machete.png"),
"red_gem_sword": load("res://assets/weapons/weapon_red_gem_sword.png"),
"regular_sword": load("res://assets/weapons/weapon_regular_sword.png"),
"rusty_sword": load("res://assets/weapons/weapon_rusty_sword.png"),
"saw_sword": load("res://assets/weapons/weapon_saw_sword.png"),
"spear": load("res://assets/weapons/weapon_spear.png")
"machete": load("res://assets/weapons/weapon_machete.png"),
"red_gem_sword": load("res://assets/weapons/weapon_red_gem_sword.png"),
"regular_sword": load("res://assets/weapons/weapon_regular_sword.png"),
"rusty_sword": load("res://assets/weapons/weapon_rusty_sword.png"),
"saw_sword": load("res://assets/weapons/weapon_saw_sword.png"),
"spear": load("res://assets/weapons/weapon_spear.png")
}
# TODO: TMP Remove

View file

@ -9,6 +9,10 @@ onready var player_sounds = get_node("AudioStream")
# Other resources -- this will need to be updated for mainhand as well
var JumpSound = preload('res://assets/sounds/player_jump.wav')
var HurtSounds = [
preload('res://assets/sounds/damage/player_hit1.wav'),
preload('res://assets/sounds/damage/player_hit2.wav'),
]
var vel : Vector2
@ -49,3 +53,10 @@ func _physics_process(_delta):
vel = move_and_slide_with_snap(next_move, Vector2.DOWN, Vector2.UP)
# Handle damage
for i in get_slide_count():
var col = get_slide_collision(i).collider
if col is KinematicBody2D:
player_sounds.stream = HurtSounds[1]
player_sounds.play()