Merge branch 'main' into native-timers

# Conflicts:
#	src/player/player.tscn
This commit is contained in:
Lilith Schier 2026-08-01 18:34:13 +02:00
commit 8b9dbd559d
195 changed files with 484 additions and 9259 deletions

View file

@ -1,17 +0,0 @@
namespace Dancer;
using Godot;
using Chickensoft.AutoInject;
using Chickensoft.Introspection;
[Meta(typeof(IAutoNode))]
public sealed partial class SlashProjectile : Node2D
{
public override void _Notification(int what) => this.Notify(what);
[Signal]
public delegate void HitboxEnteredEventHandler(Node2D other);
public void OnAttackFinished() => QueueFree();
public void OnHitboxBodyEntered(Node2D body) => EmitSignalHitboxEntered(body);
}

View file

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

View file

@ -1,21 +0,0 @@
[remap]
importer="aseprite_wizard.plugin.static-texture"
type="PortableCompressedTexture2D"
uid="uid://jdmsv25yp25v"
path="res://.godot/imported/attack.aseprite-0b3d00875a10a8cf04bab0910589e119.res"
[deps]
source_file="res://src/player/attack.aseprite"
dest_files=["res://.godot/imported/attack.aseprite-0b3d00875a10a8cf04bab0910589e119.res"]
[params]
layer/exclude_layers_pattern=""
layer/only_visible_layers=true
layer/split_layers=false
first_frame_only=false
sheet/sheet_type="horizontal"
sheet/sheet_columns=12
sheet/scale=1

View file

@ -1,21 +0,0 @@
[remap]
importer="aseprite_wizard.plugin.static-texture"
type="PortableCompressedTexture2D"
uid="uid://blw6f2ktsrcmg"
path="res://.godot/imported/hair.aseprite-733fe205726c184830ebda91637ad9f5.res"
[deps]
source_file="res://src/player/hair.aseprite"
dest_files=["res://.godot/imported/hair.aseprite-733fe205726c184830ebda91637ad9f5.res"]
[params]
layer/exclude_layers_pattern=""
layer/only_visible_layers=false
layer/split_layers=false
first_frame_only=true
sheet/sheet_type="packed"
sheet/sheet_columns=12
sheet/scale=1

BIN
src/player/light.aseprite (Stored with Git LFS)

Binary file not shown.

View file

@ -1,21 +0,0 @@
[remap]
importer="aseprite_wizard.plugin.static-texture"
type="PortableCompressedTexture2D"
uid="uid://i6xi16yki1r5"
path="res://.godot/imported/light.aseprite-43635fe79226150b3143726afd3c6190.res"
[deps]
source_file="res://src/player/light.aseprite"
dest_files=["res://.godot/imported/light.aseprite-43635fe79226150b3143726afd3c6190.res"]
[params]
layer/exclude_layers_pattern=""
layer/only_visible_layers=false
layer/split_layers=false
first_frame_only=true
sheet/sheet_type="packed"
sheet/sheet_columns=12
sheet/scale=1

View file

@ -1,21 +0,0 @@
[remap]
importer="aseprite_wizard.plugin.static-texture"
type="PortableCompressedTexture2D"
uid="uid://d0dy3j0qdycqf"
path="res://.godot/imported/player.aseprite-61ab8c4a2ca60d43d00c5a0147684013.res"
[deps]
source_file="res://src/player/player.aseprite"
dest_files=["res://.godot/imported/player.aseprite-61ab8c4a2ca60d43d00c5a0147684013.res"]
[params]
layer/exclude_layers_pattern=""
layer/only_visible_layers=true
layer/split_layers=false
first_frame_only=false
sheet/sheet_type="columns"
sheet/sheet_columns=8
sheet/scale=1

BIN
src/player/player.png (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b3ysuraousdts"
path="res://.godot/imported/player.png-ea3986bfe65d39058db1a482e686eb1d.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://src/player/player.png"
dest_files=["res://.godot/imported/player.png-ea3986bfe65d39058db1a482e686eb1d.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

View file

@ -1,9 +1,7 @@
[gd_scene format=3 uid="uid://ce2k04khaub8n"]
[ext_resource type="Script" uid="uid://b5iey2typf2tb" path="res://src/player/Player.cs" id="1_244u8"]
[ext_resource type="Texture2D" uid="uid://d0dy3j0qdycqf" path="res://src/player/player.aseprite" id="2_yw30f"]
[ext_resource type="Texture2D" uid="uid://i6xi16yki1r5" path="res://src/player/light.aseprite" id="3_mf2ua"]
[ext_resource type="Script" uid="uid://ce3atuwxo8fvb" path="res://src/combat/Hurtbox.cs" id="4_5f2sf"]
[ext_resource type="Texture2D" uid="uid://b3ysuraousdts" path="res://src/player/player.png" id="2_mf2ua"]
[ext_resource type="Script" uid="uid://b4k42r866lkut" path="res://src/combat/Hitbox.cs" id="4_244u8"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_jiejy"]
@ -100,7 +98,7 @@ tracks/0/keys = {
"times": PackedFloat32Array(0, 0.050000004, 0.116666675, 0.2, 0.28333333, 0.36666667, 0.45),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1),
"update": 1,
"values": [9, 10, 11, 12, 13, 14, 9]
"values": [16, 17, 18, 19, 20, 21, 16]
}
tracks/1/type = "value"
tracks/1/imported = false
@ -206,7 +204,7 @@ tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1),
"update": 1,
"values": [1, 2, 3, 4, 5, 6, 7, 8]
"values": [8, 9, 10, 11, 12, 13, 14, 15]
}
[sub_resource type="Animation" id="Animation_rgyib"]
@ -224,7 +222,7 @@ tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [5]
"values": [0]
}
[sub_resource type="Animation" id="Animation_244u8"]
@ -330,7 +328,6 @@ shape = SubResource("RectangleShape2D_jiejy")
[node name="SubmersedSensor" type="Area2D" parent="." unique_id=1595680866]
unique_name_in_owner = true
visible = false
collision_layer = 0
collision_mask = 32
@ -344,18 +341,12 @@ position = Vector2(0, -16)
process_callback = 0
limit_enabled = false
[node name="PointLight2D" type="PointLight2D" parent="." unique_id=1795955896]
position = Vector2(0, -16)
energy = 0.1
shadow_color = Color(0, 0, 0, 1)
texture = ExtResource("3_mf2ua")
[node name="Body" type="Sprite2D" parent="." unique_id=567060128]
unique_name_in_owner = true
texture = ExtResource("2_yw30f")
texture = ExtResource("2_mf2ua")
offset = Vector2(0, -24)
hframes = 8
vframes = 3
vframes = 8
metadata/_aseprite_wizard_interface_config_ = {
"animation_section": false,
"layer_section": false,

BIN
src/player/player_tiny.aseprite (Stored with Git LFS)

Binary file not shown.

View file

@ -1,21 +0,0 @@
[remap]
importer="aseprite_wizard.plugin.static-texture"
type="PortableCompressedTexture2D"
uid="uid://nwgwml48hdv"
path="res://.godot/imported/player_tiny.aseprite-d334ea88c331655ae2e03f376620970f.res"
[deps]
source_file="res://src/player/player_tiny.aseprite"
dest_files=["res://.godot/imported/player_tiny.aseprite-d334ea88c331655ae2e03f376620970f.res"]
[params]
layer/exclude_layers_pattern=""
layer/only_visible_layers=false
layer/split_layers=false
first_frame_only=true
sheet/sheet_type="packed"
sheet/sheet_columns=12
sheet/scale=1

View file

@ -1,114 +0,0 @@
extends Node2D
@export_custom(PROPERTY_HINT_NONE, "suffix:px")
var max_length: float = 120.0
@export_custom(PROPERTY_HINT_NONE, "suffix:px")
var distance_limit: float = 2000.0
@export_custom(PROPERTY_HINT_NONE, "suffix:px")
var segment_length: float = 5.0
@export var color: Color
@export_custom(PROPERTY_HINT_NONE, "suffix:px")
var width: float = 1.4
@export var fall_speed: float = 5.5
## The amount of different update groups to split points into.
@export var point_update_groups: int = 3
@export var new_segments_damage: bool = false
var _points: Array[RibbonPoint] = []
class RibbonPoint:
var position: Vector2
var _length: float:
get():
var current_length := 0.0
for i in _points.size() - 1:
var from = _points[i]
var to = _points[i+1]
current_length += from.position.distance_to(to.position)
return current_length
var _point_shape: Shape2D
func _ready() -> void:
_point_shape = CircleShape2D.new()
_point_shape.radius = width / 2.0
func _physics_process(delta: float) -> void:
var space_state = get_world_2d().direct_space_state
var target := global_position
if _points.is_empty() or _points.back().position.distance_to(position) > distance_limit:
var point := RibbonPoint.new()
point.position = target
_points = [point]
else:
var head: RibbonPoint = _points.back()
var distance = target.distance_to(head.position)
if (distance > segment_length / 2.0):
var point_count := ceili(distance / segment_length)
for i in point_count:
var t: float = float(i + 1) / point_count
var point: RibbonPoint = RibbonPoint.new()
point.position = lerp(head.position, target, t)
_points.push_back(point)
if new_segments_damage:
var query := PhysicsShapeQueryParameters2D.new()
var shape = SegmentShape2D.new()
shape.a = head.position
shape.b = target
query.shape = shape
query.collision_mask = 0x0000_0004
var results := space_state.intersect_shape(query)
for result in results:
print("hit creature", result.collider)
var current_length := _length
while current_length > max_length:
var popped = _points.pop_front()
var tail = _points.front()
current_length -= popped.position.distance_to(tail.position)
_update_points(delta)
func _update_points(delta: float) -> void:
var space_state = get_world_2d().direct_space_state
var query = PhysicsShapeQueryParameters2D.new()
query.shape = _point_shape
query.collision_mask = 0x0000_0001
for i in range(randi() % point_update_groups, _points.size() - 1, point_update_groups):
# Skipping the head on purpose, so it doesn't keep falling away,
# crating more and more points.
var point = _points[i]
var next = _points[i+1]
# Gravity
if (point.position.distance_to(next.position) <= segment_length * 1.5
or point.position.y < next.position.y):
var fall_distance = fall_speed * delta * point_update_groups
query.transform = Transform2D.IDENTITY.translated(point.position)
query.motion = Vector2.DOWN * fall_distance
var result := space_state.cast_motion(query)
var safe_proportion := result[0]
point.position = point.position + query.motion * safe_proportion
# Pull together
var distance_to_next: float = point.position.distance_to(next.position)
if distance_to_next > segment_length:
var move_distance = distance_to_next - segment_length
query.transform = Transform2D.IDENTITY.translated(point.position)
query.motion = (next.position - point.position).normalized() * move_distance
var result := space_state.cast_motion(query)
var safe_proportion := result[0]
point.position = point.position + query.motion * safe_proportion
func _process(delta: float) -> void:
queue_redraw()
var _packed_points = PackedVector2Array()
func _draw() -> void:
draw_set_transform_matrix(global_transform.affine_inverse())
if (_points.size() < 2): return
_packed_points.resize(_points.size())
for i in _points.size():
_packed_points[i] = _points[i].position
draw_polyline(_packed_points, color, width, false)

View file

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

View file

@ -1,77 +0,0 @@
[gd_scene format=3 uid="uid://bikcpm0fyl4pd"]
[ext_resource type="Script" uid="uid://0n1gv56pcc74" path="res://src/player/SlashProjectile.cs" id="1_bi0sp"]
[ext_resource type="PackedScene" uid="uid://cva3ecq7vp3a4" path="res://src/combat/hitbox.tscn" id="2_bi0sp"]
[sub_resource type="Animation" id="Animation_3il12"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Hitbox/CollisionShape2D:disabled")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
[sub_resource type="Animation" id="Animation_eb3da"]
resource_name = "attack"
length = 0.4
step = 0.1
tracks/0/type = "method"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0.4),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [],
"method": &"OnAttackFinished"
}]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Hitbox/CollisionShape2D:disabled")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.1, 0.3),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 1,
"values": [true, false, true]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_12t1i"]
_data = {
&"RESET": SubResource("Animation_3il12"),
&"attack": SubResource("Animation_eb3da")
}
[sub_resource type="RectangleShape2D" id="RectangleShape2D_qydbd"]
size = Vector2(32, 10)
[node name="SlashProjectile" type="Node2D" unique_id=541992074]
script = ExtResource("1_bi0sp")
[node name="AnimationPlayer" type="AnimationPlayer" parent="." unique_id=1896907748]
unique_name_in_owner = true
libraries/ = SubResource("AnimationLibrary_12t1i")
autoplay = &"attack"
[node name="Hitbox" parent="." unique_id=1918418417 instance=ExtResource("2_bi0sp")]
[node name="CollisionShape2D" parent="Hitbox" index="0" unique_id=2048987579]
position = Vector2(23, -7)
shape = SubResource("RectangleShape2D_qydbd")
[connection signal="body_entered" from="Hitbox" to="." method="OnHitboxBodyEntered"]
[editable path="Hitbox"]

View file

@ -1,21 +0,0 @@
[remap]
importer="aseprite_wizard.plugin.static-texture"
type="PortableCompressedTexture2D"
uid="uid://mc1svittoh76"
path="res://.godot/imported/energy_bar.aseprite-5b8ca4afaff2301251090a90413e99f9.res"
[deps]
source_file="res://src/player/ui/energy_bar.aseprite"
dest_files=["res://.godot/imported/energy_bar.aseprite-5b8ca4afaff2301251090a90413e99f9.res"]
[params]
layer/exclude_layers_pattern=""
layer/only_visible_layers=false
layer/split_layers=false
first_frame_only=true
sheet/sheet_type="packed"
sheet/sheet_columns=12
sheet/scale=1

BIN
src/player/ui/energy_bar.png (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dwiu5ej85fc3i"
path="res://.godot/imported/energy_bar.png-5d692337a8d4fc75932e5331744e6f31.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://src/player/ui/energy_bar.png"
dest_files=["res://.godot/imported/energy_bar.png-5d692337a8d4fc75932e5331744e6f31.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

View file

@ -1,21 +0,0 @@
[remap]
importer="aseprite_wizard.plugin.static-texture"
type="PortableCompressedTexture2D"
uid="uid://b8bc8ahlqu0qv"
path="res://.godot/imported/hp_bar.aseprite-ffb900533de34c8a616bd4c778a70ea7.res"
[deps]
source_file="res://src/player/ui/hp_bar.aseprite"
dest_files=["res://.godot/imported/hp_bar.aseprite-ffb900533de34c8a616bd4c778a70ea7.res"]
[params]
layer/exclude_layers_pattern=""
layer/only_visible_layers=false
layer/split_layers=false
first_frame_only=true
sheet/sheet_type="packed"
sheet/sheet_columns=12
sheet/scale=1

BIN
src/player/ui/hp_bar.png (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c0kdbshy1ipbe"
path="res://.godot/imported/hp_bar.png-fce09f911d5101836dd4a642325ba1e7.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://src/player/ui/hp_bar.png"
dest_files=["res://.godot/imported/hp_bar.png-fce09f911d5101836dd4a642325ba1e7.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

View file

@ -1,21 +0,0 @@
[remap]
importer="aseprite_wizard.plugin.static-texture"
type="PortableCompressedTexture2D"
uid="uid://ytvw63oqb6lf"
path="res://.godot/imported/player_hud.aseprite-e0de957c13b015f06cc6272b33306712.res"
[deps]
source_file="res://src/player/ui/player_hud.aseprite"
dest_files=["res://.godot/imported/player_hud.aseprite-e0de957c13b015f06cc6272b33306712.res"]
[params]
layer/exclude_layers_pattern=""
layer/only_visible_layers=true
layer/split_layers=false
first_frame_only=true
sheet/sheet_type="packed"
sheet/sheet_columns=12
sheet/scale=1

BIN
src/player/ui/player_hud.png (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b7xxxshusx3sm"
path="res://.godot/imported/player_hud.png-17c4147e4f4eb6f0681b63f601977a48.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://src/player/ui/player_hud.png"
dest_files=["res://.godot/imported/player_hud.png-17c4147e4f4eb6f0681b63f601977a48.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

View file

@ -1,9 +1,9 @@
[gd_scene format=3 uid="uid://llohfwmma2hv"]
[ext_resource type="Script" uid="uid://dsbiwhvdat5ul" path="res://src/player/ui/PlayerHud.cs" id="1_580w7"]
[ext_resource type="Texture2D" uid="uid://b8bc8ahlqu0qv" path="res://src/player/ui/hp_bar.aseprite" id="2_nuiq8"]
[ext_resource type="Texture2D" uid="uid://ytvw63oqb6lf" path="res://src/player/ui/player_hud.aseprite" id="2_uku0i"]
[ext_resource type="Texture2D" uid="uid://mc1svittoh76" path="res://src/player/ui/energy_bar.aseprite" id="3_580w7"]
[ext_resource type="Texture2D" uid="uid://b7xxxshusx3sm" path="res://src/player/ui/player_hud.png" id="2_580w7"]
[ext_resource type="Texture2D" uid="uid://c0kdbshy1ipbe" path="res://src/player/ui/hp_bar.png" id="3_uku0i"]
[ext_resource type="Texture2D" uid="uid://dwiu5ej85fc3i" path="res://src/player/ui/energy_bar.png" id="4_uku0i"]
[node name="PlayerHud" type="Control" unique_id=763981532]
layout_mode = 3
@ -16,7 +16,7 @@ script = ExtResource("1_580w7")
layout_mode = 0
offset_right = 64.0
offset_bottom = 24.0
texture = ExtResource("2_uku0i")
texture = ExtResource("2_580w7")
[node name="HpBar" type="TextureProgressBar" parent="." unique_id=1950685336]
unique_name_in_owner = true
@ -26,7 +26,7 @@ offset_top = 6.0
offset_right = 60.0
offset_bottom = 46.0
value = 100.0
texture_progress = ExtResource("2_nuiq8")
texture_progress = ExtResource("3_uku0i")
[node name="Control" type="Control" parent="." unique_id=302593641]
anchors_preset = 0
@ -43,7 +43,7 @@ offset_bottom = 40.0
max_value = 1.0
step = 0.1
value = 1.0
texture_progress = ExtResource("3_580w7")
texture_progress = ExtResource("4_uku0i")
[node name="EnergyBar1" type="TextureProgressBar" parent="Control" unique_id=177919498]
unique_name_in_owner = true
@ -54,7 +54,7 @@ offset_bottom = 40.0
max_value = 1.0
step = 0.1
value = 1.0
texture_progress = ExtResource("3_580w7")
texture_progress = ExtResource("4_uku0i")
[node name="EnergyBar2" type="TextureProgressBar" parent="Control" unique_id=1462542424]
unique_name_in_owner = true
@ -65,4 +65,4 @@ offset_bottom = 40.0
max_value = 1.0
step = 0.1
value = 0.5
texture_progress = ExtResource("3_580w7")
texture_progress = ExtResource("4_uku0i")