You've already forked Darklings-FightingGame
mirror of
https://github.com/izzy2lost/Darklings-FightingGame.git
synced 2026-03-10 11:35:19 -07:00
30 lines
902 B
C#
30 lines
902 B
C#
public class FallState : AirParentState
|
|
{
|
|
public override void UpdateLogic(PlayerNetwork player)
|
|
{
|
|
CheckFlip(player);
|
|
if (!player.enter)
|
|
{
|
|
player.enter = true;
|
|
player.animation = "Fall";
|
|
player.animationFrames = 0;
|
|
return;
|
|
}
|
|
player.velocity = new DemonVector2(player.velocity.x, player.velocity.y - DemonicsPhysics.GRAVITY);
|
|
if (!player.usedShadowbreak)
|
|
base.UpdateLogic(player);
|
|
else
|
|
ToHurtState(player);
|
|
ToIdleState(player);
|
|
}
|
|
private void ToIdleState(PlayerNetwork player)
|
|
{
|
|
if (player.position.y <= DemonicsPhysics.GROUND_POINT)
|
|
{
|
|
player.usedShadowbreak = false;
|
|
player.sound = "Landed";
|
|
player.SetParticle("Fall", player.position);
|
|
EnterState(player, "Idle");
|
|
}
|
|
}
|
|
} |