new player art

This commit is contained in:
Lilith Schier 2026-06-19 00:35:46 +02:00
parent 562a33bd8e
commit f774f8e8a4
65 changed files with 2953 additions and 276 deletions

View file

@ -1,10 +1,9 @@
using System.Collections.Generic;
using System.Text;
namespace Dancer;
[Meta(typeof(IAutoNode))]
public sealed partial class Player : CharacterBody2D, IAttackable
public sealed partial class Player : CharacterBody2D, IAttackable, IHitboxOwner, IProvide<IHitboxOwner>
{
public override void _Notification(int what) => this.Notify(what);
@ -21,13 +20,13 @@ public sealed partial class Player : CharacterBody2D, IAttackable
public float GroundedSpeedStopDecay { get; set; } = 0.005f;
[Export(PropertyHint.None, "suffix:px/s")]
public float WalkMaxSpeed { get; set; } = 110.0f;
public float WalkMaxSpeed { get; set; } = 130.0f;
[Export(PropertyHint.None, "suffix:px/s²")]
public float WalkAccel { get; set; } = 600.0f;
public float WalkAccel { get; set; } = 900.0f;
[Export(PropertyHint.None, "suffix:px/s²")]
public float AirAccel { get; set; } = 180.0f;
public float AirAccel { get; set; } = 210.0f;
[Export(PropertyHint.None, "suffix:s")]
public float JumpAscentMaxTime { get; set; } = 0.2f;
@ -50,23 +49,24 @@ public sealed partial class Player : CharacterBody2D, IAttackable
public float DownInputAngle { get; set; } = Mathf.Pi / 4;
[Export] public float MaxHealth { get; set; } = 5f;
public float Health { get; set; }
[Export] public float Health { get; set; }
[Export] public bool CanTurn { get; set; } = true;
private ulong MaxInputBufferTimeMicroseconds => (ulong)(MaxInputBufferTime * 1_000_000);
private float _jumpAscentRemainingTime;
private bool _isJumping;
private float _jumpAllowedTime;
private Vector2 _currentDirection = Vector2.Zero;
private bool _isFacingRight = true;
private AnimationNodeStateMachinePlayback _playback = null!;
private List<BufferedInput> _inputBuffer = [];
[Node] private AnimationTree AnimationTree { get; set; } = null!;
public override void _Ready()
public void OnReady()
{
this.Provide();
SetPhysicsProcess(true);
Health = MaxHealth;
_playback = AnimationTree.Get("parameters/playback").As<AnimationNodeStateMachinePlayback>();
}
@ -101,16 +101,13 @@ public sealed partial class Player : CharacterBody2D, IAttackable
}
}
public override void _PhysicsProcess(double delta)
public void OnPhysicsProcess(double delta)
{
var deltaF = (float)delta;
// Temporary copy of the velocity for easier editing.
var velocity = Velocity;
if (_currentDirection.X < 0)
_isFacingRight = false;
else if (_currentDirection.X > 0)
_isFacingRight = true;
if (CanTurn) AdjustFacing();
// Walking on the floor
if (IsOnFloor())
@ -171,6 +168,14 @@ public sealed partial class Player : CharacterBody2D, IAttackable
}
}
private void AdjustFacing()
{
if (_currentDirection.X < 0)
_isFacingRight = false;
else if (_currentDirection.X > 0)
_isFacingRight = true;
}
private bool IsHoldingWall()
{
return
@ -199,15 +204,6 @@ public sealed partial class Player : CharacterBody2D, IAttackable
_inputBuffer.RemoveAt(0);
}
{
var inputBuffer = new StringBuilder();
foreach (var bufferedInput in _inputBuffer)
{
inputBuffer.Append($"{bufferedInput}, ");
}
GD.Print(inputBuffer);
}
// Check new commands
for (var i = 0; i < _inputBuffer.Count; i++)
{
@ -236,7 +232,7 @@ public sealed partial class Player : CharacterBody2D, IAttackable
else if (input.Event.IsActionPressed("attack"))
{
inputFound = true;
Slash();
Attack();
}
if (inputFound)
@ -249,6 +245,7 @@ public sealed partial class Player : CharacterBody2D, IAttackable
private void GroundJump()
{
AdjustFacing();
_jumpAllowedTime = 0.0f;
_jumpAscentRemainingTime = JumpAscentMaxTime;
_isJumping = true;
@ -256,6 +253,7 @@ public sealed partial class Player : CharacterBody2D, IAttackable
private void WallJump()
{
AdjustFacing();
_jumpAllowedTime = 0.0f;
Velocity += GetWallNormal() * 200.0f;
Velocity = Velocity with { Y = Mathf.Min(0, Velocity.Y) };
@ -270,16 +268,11 @@ public sealed partial class Player : CharacterBody2D, IAttackable
Velocity = Velocity with { Y = Velocity.Y * 0.1f };
}
private void Slash()
private void Attack()
{
AdjustFacing();
Velocity += (_isFacingRight ? Vector2.Right : Vector2.Left) * SlashSpeedBoost;
_playback.Travel("attack");
var instance = GD.Load<PackedScene>("res://src/player/slash_projectile.tscn")
.Instantiate<SlashProjectile>();
AddChild(instance);
instance.GlobalTransform = GetNode<Node2D>("%HandAttachment").GlobalTransform;
instance.HitboxEntered += OnEnemyHit;
_playback.Travel("front_kick");
}
private bool IsInputVecDown(Vector2 vec)
@ -287,14 +280,14 @@ public sealed partial class Player : CharacterBody2D, IAttackable
return Mathf.Abs(vec.AngleTo(Vector2.Down)) < DownInputAngle && vec.Length() > 0.1f;
}
private void OnEnemyHit(Node2D enemy)
private void OnEnemyHit(Hitbox hitbox, Node2D enemy)
{
if (enemy is not IAttackable attackable) return;
attackable.GetAttacked(new()
{
Attacker = this,
Damage = 1.0f,
Impulse = Vector2.Down * 1000.0f + (enemy.Position - Position).Normalized() * 1000.0f,
Impulse = Vector2.Up * 1000.0f + (enemy.Position - Position).Normalized() * 1000.0f,
});
}
@ -309,4 +302,8 @@ public sealed partial class Player : CharacterBody2D, IAttackable
public required InputEvent Event { get; init; }
public ulong Time { get; init; }
}
public void OnHitboxAdded(Hitbox hitbox) => hitbox.BodyHit += OnEnemyHit;
public void OnHitboxRemoved(Hitbox hitbox) => hitbox.BodyHit -= OnEnemyHit;
IHitboxOwner IProvide<IHitboxOwner>.Value() => this;
}

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

Binary file not shown.

View file

@ -0,0 +1,21 @@
[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

Binary file not shown.

View file

@ -16,6 +16,6 @@ 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/sheet_type="columns"
sheet/sheet_columns=8
sheet/scale=1

View file

@ -1,13 +1,18 @@
[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="Script" uid="uid://bhijvek6js88u" path="res://src/spring/Spring2D.cs" id="2_mf2ua"]
[ext_resource type="Texture2D" uid="uid://d0dy3j0qdycqf" path="res://src/player/player.aseprite" id="2_yw30f"]
[ext_resource type="Texture2D" uid="uid://blw6f2ktsrcmg" path="res://src/player/hair.aseprite" id="3_qjkh3"]
[ext_resource type="Texture2D" uid="uid://i6xi16yki1r5" path="res://src/player/light.aseprite" id="3_mf2ua"]
[ext_resource type="Script" uid="uid://b4k42r866lkut" path="res://src/combat/Hitbox.cs" id="4_244u8"]
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_e2o6t"]
radius = 4.0
height = 14.0
[sub_resource type="RectangleShape2D" id="RectangleShape2D_jiejy"]
size = Vector2(10, 28)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_244u8"]
size = Vector2(27.5, 20)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_5f2sf"]
size = Vector2(13.59375, 20)
[sub_resource type="Animation" id="Animation_yw30f"]
resource_name = "RESET"
@ -25,6 +30,112 @@ tracks/0/keys = {
"update": 1,
"values": [0]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath(".:CanTurn")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("Body/FrontKick/CollisionShape2D:disabled")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("Body/FrontKick/CollisionShape2D2:disabled")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
[sub_resource type="Animation" id="Animation_g6k8r"]
resource_name = "front_kick"
length = 0.55
step = 0.016666668
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Body:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
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]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath(".:CanTurn")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.45),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [false, true]
}
tracks/2/type = "method"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("Body/FrontKick")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0.05, 0.36666667),
"transitions": PackedFloat32Array(1, 1),
"values": [{
"args": [],
"method": &"StartAttack"
}, {
"args": [],
"method": &"StopAttack"
}]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("Body/FrontKick/CollisionShape2D:disabled")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0.050000004, 0.28333336),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [false, true]
}
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("Body/FrontKick/CollisionShape2D2:disabled")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0.050000004, 0.20000002),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [true, false]
}
[sub_resource type="Animation" id="Animation_qjkh3"]
resource_name = "idle"
@ -44,26 +155,9 @@ tracks/0/keys = {
"values": [0]
}
[sub_resource type="Animation" id="Animation_g6k8r"]
resource_name = "slash"
length = 0.20000167
step = 0.05
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Body:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [6]
}
[sub_resource type="Animation" id="Animation_boad6"]
resource_name = "walk"
length = 0.400005
resource_name = "run"
length = 0.8
loop_mode = 1
step = 0.1
tracks/0/type = "value"
@ -73,10 +167,10 @@ tracks/0/path = NodePath("Body:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3),
"transitions": PackedFloat32Array(1, 1, 1, 1),
"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": [0, 1, 2, 3]
"values": [1, 2, 3, 4, 5, 6, 7, 8]
}
[sub_resource type="Animation" id="Animation_rgyib"]
@ -100,20 +194,20 @@ tracks/0/keys = {
[sub_resource type="AnimationLibrary" id="AnimationLibrary_rgyib"]
_data = {
&"RESET": SubResource("Animation_yw30f"),
&"front_kick": SubResource("Animation_g6k8r"),
&"idle": SubResource("Animation_qjkh3"),
&"slash": SubResource("Animation_g6k8r"),
&"walk": SubResource("Animation_boad6"),
&"run": SubResource("Animation_boad6"),
&"wall_hold": SubResource("Animation_rgyib")
}
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_qjkh3"]
animation = &"slash"
animation = &"front_kick"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_yw30f"]
animation = &"idle"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_g6k8r"]
animation = &"walk"
animation = &"run"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_boad6"]
animation = &"wall_hold"
@ -150,15 +244,15 @@ advance_expression = "not IsHoldingWall()"
[sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_yllr7"]
allow_transition_to_self = true
states/attack/node = SubResource("AnimationNodeAnimation_qjkh3")
states/attack/position = Vector2(604.5, 41.5)
states/front_kick/node = SubResource("AnimationNodeAnimation_qjkh3")
states/front_kick/position = Vector2(604.5, 41.5)
states/idle/node = SubResource("AnimationNodeAnimation_yw30f")
states/idle/position = Vector2(428.5, 88.5)
states/walk/node = SubResource("AnimationNodeAnimation_g6k8r")
states/walk/position = Vector2(628.5, 203.5)
states/run/node = SubResource("AnimationNodeAnimation_g6k8r")
states/run/position = Vector2(628.5, 203.5)
states/wall_hold/node = SubResource("AnimationNodeAnimation_boad6")
states/wall_hold/position = Vector2(362.82965, 231.5)
transitions = ["attack", "idle", SubResource("AnimationNodeStateMachineTransition_boad6"), "idle", "attack", SubResource("AnimationNodeStateMachineTransition_rgyib"), "Start", "idle", SubResource("AnimationNodeStateMachineTransition_hg6s5"), "idle", "walk", SubResource("AnimationNodeStateMachineTransition_8t03j"), "walk", "idle", SubResource("AnimationNodeStateMachineTransition_2ieo8"), "walk", "attack", SubResource("AnimationNodeStateMachineTransition_ebec5"), "idle", "wall_hold", SubResource("AnimationNodeStateMachineTransition_yllr7"), "wall_hold", "idle", SubResource("AnimationNodeStateMachineTransition_kb6p2")]
transitions = ["front_kick", "idle", SubResource("AnimationNodeStateMachineTransition_boad6"), "idle", "front_kick", SubResource("AnimationNodeStateMachineTransition_rgyib"), "Start", "idle", SubResource("AnimationNodeStateMachineTransition_hg6s5"), "idle", "run", SubResource("AnimationNodeStateMachineTransition_8t03j"), "run", "idle", SubResource("AnimationNodeStateMachineTransition_2ieo8"), "run", "front_kick", SubResource("AnimationNodeStateMachineTransition_ebec5"), "idle", "wall_hold", SubResource("AnimationNodeStateMachineTransition_yllr7"), "wall_hold", "idle", SubResource("AnimationNodeStateMachineTransition_kb6p2")]
graph_offset = Vector2(-59.670364, -27)
[node name="Player" type="CharacterBody2D" unique_id=500011307]
@ -170,17 +264,26 @@ floor_max_angle = 0.24783675
script = ExtResource("1_244u8")
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=84142517]
position = Vector2(0, 1)
shape = SubResource("CapsuleShape2D_e2o6t")
position = Vector2(0, -14)
shape = SubResource("RectangleShape2D_jiejy")
[node name="Camera2D" type="Camera2D" parent="." unique_id=1975474809]
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")
hframes = 7
offset = Vector2(0, -24)
hframes = 8
vframes = 2
metadata/_aseprite_wizard_interface_config_ = {
"animation_section": false,
"layer_section": false,
@ -211,23 +314,34 @@ metadata/_aseprite_wizard_config_ = {
}
metadata/_aseprite_wizard_source_file_hash_ = "61168df4a163c039cfaab97f4fccb905"
[node name="Spring2D" type="Node2D" parent="Body" unique_id=1050714188]
show_behind_parent = true
script = ExtResource("2_mf2ua")
[node name="Hair" type="Sprite2D" parent="Body/Spring2D" unique_id=796557000]
position = Vector2(-2, 2)
texture = ExtResource("3_qjkh3")
[node name="HandAttachment" type="Node2D" parent="Body" unique_id=1002134601]
unique_name_in_owner = true
position = Vector2(3, 2)
position = Vector2(0, -14)
[node name="FrontKick" type="Area2D" parent="Body" unique_id=1918418417]
process_mode = 4
visible = false
position = Vector2(0, -16)
collision_layer = 8
collision_mask = 4
script = ExtResource("4_244u8")
[node name="CollisionShape2D" type="CollisionShape2D" parent="Body/FrontKick" unique_id=2048987579]
position = Vector2(5, 7)
shape = SubResource("RectangleShape2D_244u8")
debug_color = Color(0.99430805, 0, 0.2314094, 0.41960785)
[node name="CollisionShape2D2" type="CollisionShape2D" parent="Body/FrontKick" unique_id=734742131]
position = Vector2(16, -2)
shape = SubResource("RectangleShape2D_5f2sf")
debug_color = Color(0.99430805, 0, 0.2314094, 0.41960785)
[node name="AnimationPlayer" type="AnimationPlayer" parent="." unique_id=1251324400]
libraries/ = SubResource("AnimationLibrary_rgyib")
[node name="AnimationTree" type="AnimationTree" parent="AnimationPlayer" unique_id=1839424284]
unique_name_in_owner = true
deterministic = false
root_node = NodePath("%AnimationTree/../..")
tree_root = SubResource("AnimationNodeStateMachine_yllr7")
advance_expression_base_node = NodePath("../..")

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

Binary file not shown.

View file

@ -0,0 +1,21 @@
[remap]
importer="aseprite_wizard.plugin.static-texture"
type="PortableCompressedTexture2D"
uid="uid://ddaoshqpfh1t4"
path="res://.godot/imported/player_old.aseprite-47ad749bdb952bbe0ea8d9f38e3427b5.res"
[deps]
source_file="res://src/player/player_old.aseprite"
dest_files=["res://.godot/imported/player_old.aseprite-47ad749bdb952bbe0ea8d9f38e3427b5.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/player_tiny.aseprite (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -0,0 +1,21 @@
[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,32 +1,20 @@
[gd_scene format=3 uid="uid://bikcpm0fyl4pd"]
[ext_resource type="Texture2D" uid="uid://jdmsv25yp25v" path="res://src/player/attack.aseprite" id="1_3il12"]
[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("Attack:frame")
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": [0]
}
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),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
@ -34,25 +22,13 @@ tracks/1/keys = {
resource_name = "attack"
length = 0.4
step = 0.1
tracks/0/type = "value"
tracks/0/type = "method"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Attack:frame")
tracks/0/path = NodePath(".")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 1,
"values": [0, 1, 2]
}
tracks/1/type = "method"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath(".")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0.4),
"transitions": PackedFloat32Array(1),
"values": [{
@ -60,13 +36,13 @@ tracks/1/keys = {
"method": &"OnAttackFinished"
}]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("Hitbox/CollisionShape2D:disabled")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
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,
@ -79,30 +55,23 @@ _data = {
&"attack": SubResource("Animation_eb3da")
}
[sub_resource type="RectangleShape2D" id="RectangleShape2D_u7cw4"]
[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="Attack" type="Sprite2D" parent="." unique_id=30274790]
position = Vector2(16, -3)
texture = ExtResource("1_3il12")
hframes = 3
[node name="AnimationPlayer" type="AnimationPlayer" parent="." unique_id=1896907748]
unique_name_in_owner = true
libraries/ = SubResource("AnimationLibrary_12t1i")
autoplay = &"attack"
[node name="Hitbox" type="Area2D" parent="." unique_id=133086557]
collision_layer = 8
collision_mask = 4
[node name="Hitbox" parent="." unique_id=1918418417 instance=ExtResource("2_bi0sp")]
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox" unique_id=1668475985]
position = Vector2(21, -5)
shape = SubResource("RectangleShape2D_u7cw4")
disabled = true
debug_color = Color(0.99430805, 0, 0.2314094, 0.41960785)
[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"]