wip
This commit is contained in:
parent
b37c78d75b
commit
9f404261ae
27 changed files with 681 additions and 5 deletions
|
|
@ -125,7 +125,7 @@ public sealed partial class Player : CharacterBody2D, IAttackable, IHitboxOwner,
|
|||
// Water movement
|
||||
if (_isInWater)
|
||||
{
|
||||
velocity += _currentDirection * WaterAccel * deltaF;
|
||||
velocity += _currentDirection.Normalized() * WaterAccel * deltaF;
|
||||
}
|
||||
// Walking on the floor
|
||||
else if (IsOnFloor())
|
||||
|
|
@ -147,7 +147,7 @@ public sealed partial class Player : CharacterBody2D, IAttackable, IHitboxOwner,
|
|||
// Air control
|
||||
else
|
||||
{
|
||||
velocity.X += _currentDirection.X * AirAccel * deltaF;
|
||||
velocity.X += Mathf.Sign(_currentDirection.X) * AirAccel * deltaF;
|
||||
}
|
||||
|
||||
// Move up while holding jump
|
||||
|
|
@ -190,6 +190,7 @@ public sealed partial class Player : CharacterBody2D, IAttackable, IHitboxOwner,
|
|||
{
|
||||
CollisionMask = 0b0100_0001;
|
||||
}
|
||||
|
||||
MoveAndSlide();
|
||||
|
||||
JumpAllowedTime = Mathf.Max(0, JumpAllowedTime - deltaF);
|
||||
|
|
@ -334,15 +335,26 @@ public sealed partial class Player : CharacterBody2D, IAttackable, IHitboxOwner,
|
|||
_playback.Travel("front_kick");
|
||||
}
|
||||
|
||||
private bool IsAtWaterSurface()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
private void WaterExitJump()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
private bool IsInputVecDown(Vector2 vec)
|
||||
{
|
||||
return Mathf.Abs(vec.AngleTo(Vector2.Down)) < DownInputAngle && vec.Length() > 0.01f;
|
||||
}
|
||||
|
||||
private bool IsInputVecSide(Vector2 vec)
|
||||
{
|
||||
return vec.Length() > 0.01f
|
||||
&& (Mathf.Abs(vec.AngleTo(Vector2.Left)) < SideInputAngle
|
||||
|| Mathf.Abs(vec.AngleTo(Vector2.Right)) < SideInputAngle) ;
|
||||
&& (Mathf.Abs(vec.AngleTo(Vector2.Left)) < SideInputAngle
|
||||
|| Mathf.Abs(vec.AngleTo(Vector2.Right)) < SideInputAngle);
|
||||
}
|
||||
|
||||
private void OnEnemyHit(Hitbox hitbox, Node2D enemy)
|
||||
|
|
@ -402,6 +414,7 @@ public sealed partial class Player : CharacterBody2D, IAttackable, IHitboxOwner,
|
|||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
[Meta]
|
||||
public sealed partial record Airborne : Root, IGet<Input.OnPhysicsProcess>
|
||||
{
|
||||
|
|
@ -410,6 +423,7 @@ public sealed partial class Player : CharacterBody2D, IAttackable, IHitboxOwner,
|
|||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
[Meta]
|
||||
public sealed partial record Diving : Root, IGet<Input.OnPhysicsProcess>
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue