more player states?
This commit is contained in:
parent
7846f1a068
commit
4d0ad13bf3
2 changed files with 21 additions and 6 deletions
|
|
@ -172,6 +172,7 @@ texture_repeat = 2
|
||||||
texture = ExtResource("5_wqvko")
|
texture = ExtResource("5_wqvko")
|
||||||
region_enabled = true
|
region_enabled = true
|
||||||
region_rect = Rect2(0, 0, 10000, 10000)
|
region_rect = Rect2(0, 0, 10000, 10000)
|
||||||
|
metadata/_edit_lock_ = true
|
||||||
|
|
||||||
[node name="Level" type="Node2D" parent="World" unique_id=1470134692]
|
[node name="Level" type="Node2D" parent="World" unique_id=1470134692]
|
||||||
|
|
||||||
|
|
@ -221,3 +222,4 @@ offset_bottom = 34.0
|
||||||
mouse_filter = 2
|
mouse_filter = 2
|
||||||
script = ExtResource("6_pk08u")
|
script = ExtResource("6_pk08u")
|
||||||
Player = NodePath("../../../World/Player")
|
Player = NodePath("../../../World/Player")
|
||||||
|
metadata/_edit_use_anchors_ = true
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Specialized;
|
using System.Collections.Specialized;
|
||||||
using Chickensoft.LogicBlocks;
|
using Chickensoft.LogicBlocks;
|
||||||
|
|
@ -42,7 +43,7 @@ public sealed partial class Player : CharacterBody2D, IAttackable, IHitboxOwner,
|
||||||
public float JumpAscentSpeed { get; set; } = 200.0f;
|
public float JumpAscentSpeed { get; set; } = 200.0f;
|
||||||
|
|
||||||
[Export(PropertyHint.None, "suffix:s")]
|
[Export(PropertyHint.None, "suffix:s")]
|
||||||
public float LateJumpTimeLimit { get; set; } = 0.15f;
|
public float LateJumpTimeLimit { get; set; } = 0.1f;
|
||||||
|
|
||||||
[Export(PropertyHint.None, "suffix:s")]
|
[Export(PropertyHint.None, "suffix:s")]
|
||||||
public float SlashSpeedBoost { get; set; } = 90.0f;
|
public float SlashSpeedBoost { get; set; } = 90.0f;
|
||||||
|
|
@ -335,11 +336,11 @@ public sealed partial class Player : CharacterBody2D, IAttackable, IHitboxOwner,
|
||||||
|
|
||||||
private bool IsInputVecDown(Vector2 vec)
|
private bool IsInputVecDown(Vector2 vec)
|
||||||
{
|
{
|
||||||
return Mathf.Abs(vec.AngleTo(Vector2.Down)) < DownInputAngle && vec.Length() > 0.1f;
|
return Mathf.Abs(vec.AngleTo(Vector2.Down)) < DownInputAngle && vec.Length() > 0.01f;
|
||||||
}
|
}
|
||||||
private bool IsInputVecSide(Vector2 vec)
|
private bool IsInputVecSide(Vector2 vec)
|
||||||
{
|
{
|
||||||
return vec.Length() > 0.1f
|
return vec.Length() > 0.01f
|
||||||
&& (Mathf.Abs(vec.AngleTo(Vector2.Left)) < SideInputAngle
|
&& (Mathf.Abs(vec.AngleTo(Vector2.Left)) < SideInputAngle
|
||||||
|| Mathf.Abs(vec.AngleTo(Vector2.Right)) < SideInputAngle) ;
|
|| Mathf.Abs(vec.AngleTo(Vector2.Right)) < SideInputAngle) ;
|
||||||
}
|
}
|
||||||
|
|
@ -394,16 +395,28 @@ public sealed partial class Player : CharacterBody2D, IAttackable, IHitboxOwner,
|
||||||
public abstract partial record Root : LogicBlockState
|
public abstract partial record Root : LogicBlockState
|
||||||
{
|
{
|
||||||
[Meta]
|
[Meta]
|
||||||
public sealed partial record Grounded : Root
|
public sealed partial record Grounded : Root, IGet<Input.OnPhysicsProcess>
|
||||||
{
|
{
|
||||||
|
public Type On(in Input.OnPhysicsProcess input)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
[Meta]
|
[Meta]
|
||||||
public sealed partial record Airborne : Root
|
public sealed partial record Airborne : Root, IGet<Input.OnPhysicsProcess>
|
||||||
{
|
{
|
||||||
|
public Type On(in Input.OnPhysicsProcess input)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
[Meta]
|
[Meta]
|
||||||
public sealed partial record Diving : Root
|
public sealed partial record Diving : Root, IGet<Input.OnPhysicsProcess>
|
||||||
{
|
{
|
||||||
|
public Type On(in Input.OnPhysicsProcess input)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue