implemented a little dash animation
This commit is contained in:
parent
77a7075703
commit
26dc7d4f57
4 changed files with 38 additions and 8 deletions
|
|
@ -65,6 +65,7 @@ public sealed partial class Player : CharacterBody2D, IAttackable, IHitboxOwner,
|
|||
private AnimationNodeStateMachinePlayback _playback = null!;
|
||||
public List<BufferedInput> InputBuffer { get; } = [];
|
||||
public bool IsInWater { get; private set; }
|
||||
public bool IsDashing => !DashTimer.IsStopped();
|
||||
public Vector2 DashDirection { get; set; }
|
||||
public float DashPoints { get; set; }
|
||||
public float BankedDashPoints { get; set; }
|
||||
|
|
@ -436,6 +437,7 @@ public sealed partial class Player : CharacterBody2D, IAttackable, IHitboxOwner,
|
|||
: _currentDirection
|
||||
).Normalized();
|
||||
DashHitbox.StartAttack();
|
||||
_playback.Travel("side_dash");
|
||||
}
|
||||
|
||||
private void Parry() => ParryTimer.Start();
|
||||
|
|
|
|||
BIN
src/player/player.aseprite
(Stored with Git LFS)
BIN
src/player/player.aseprite
(Stored with Git LFS)
Binary file not shown.
BIN
src/player/player.png
(Stored with Git LFS)
BIN
src/player/player.png
(Stored with Git LFS)
Binary file not shown.
|
|
@ -208,6 +208,22 @@ tracks/0/keys = {
|
|||
"values": [8, 9, 10, 11, 12, 13, 14, 15]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_5f2sf"]
|
||||
resource_name = "side_dash"
|
||||
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.016666668),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [32]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_rgyib"]
|
||||
resource_name = "wall_hold"
|
||||
length = 1.0000017
|
||||
|
|
@ -249,6 +265,7 @@ _data = {
|
|||
&"idle": SubResource("Animation_qjkh3"),
|
||||
&"parry": SubResource("Animation_jiejy"),
|
||||
&"run": SubResource("Animation_boad6"),
|
||||
&"side_dash": SubResource("Animation_5f2sf"),
|
||||
&"wall_hold": SubResource("Animation_rgyib"),
|
||||
&"water_idle": SubResource("Animation_244u8")
|
||||
}
|
||||
|
|
@ -265,6 +282,9 @@ animation = &"parry"
|
|||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_g6k8r"]
|
||||
animation = &"run"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_244u8"]
|
||||
animation = &"side_dash"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_boad6"]
|
||||
animation = &"wall_hold"
|
||||
|
||||
|
|
@ -292,11 +312,17 @@ advance_expression = "_is_on_wall()"
|
|||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_yllr7"]
|
||||
advance_mode = 2
|
||||
advance_expression = "IsHoldingWall()"
|
||||
advance_expression = "IsHoldingWall"
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_kb6p2"]
|
||||
advance_mode = 2
|
||||
advance_expression = "not IsHoldingWall()"
|
||||
advance_expression = "not IsHoldingWall"
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_5f2sf"]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_244u8"]
|
||||
advance_mode = 2
|
||||
advance_expression = "not IsDashing"
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_yllr7"]
|
||||
allow_transition_to_self = true
|
||||
|
|
@ -309,9 +335,11 @@ states/parry/node = SubResource("AnimationNodeAnimation_5f2sf")
|
|||
states/parry/position = Vector2(544.82965, 277.5)
|
||||
states/run/node = SubResource("AnimationNodeAnimation_g6k8r")
|
||||
states/run/position = Vector2(678.5, 215.5)
|
||||
states/side_dash/node = SubResource("AnimationNodeAnimation_244u8")
|
||||
states/side_dash/position = Vector2(316.82965, -7.5)
|
||||
states/wall_hold/node = SubResource("AnimationNodeAnimation_boad6")
|
||||
states/wall_hold/position = Vector2(362.82965, 231.5)
|
||||
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")]
|
||||
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"), "idle", "side_dash", SubResource("AnimationNodeStateMachineTransition_5f2sf"), "side_dash", "idle", SubResource("AnimationNodeStateMachineTransition_244u8")]
|
||||
graph_offset = Vector2(-48.670364, -38)
|
||||
|
||||
[node name="Player" type="CharacterBody2D" unique_id=500011307]
|
||||
|
|
@ -349,7 +377,7 @@ unique_name_in_owner = true
|
|||
texture = ExtResource("2_mf2ua")
|
||||
offset = Vector2(0, -24)
|
||||
hframes = 8
|
||||
vframes = 8
|
||||
vframes = 9
|
||||
metadata/_aseprite_wizard_interface_config_ = {
|
||||
"animation_section": false,
|
||||
"layer_section": false,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue