You've already forked Darklings-FightingGame
mirror of
https://github.com/izzy2lost/Darklings-FightingGame.git
synced 2026-03-10 11:35:19 -07:00
40 lines
1.2 KiB
C#
40 lines
1.2 KiB
C#
using UnityEngine;
|
|
|
|
public class WallSplatState : State
|
|
{
|
|
public override void UpdateLogic(PlayerNetwork player)
|
|
{
|
|
CheckFlip(player);
|
|
if (!player.enter)
|
|
{
|
|
player.wasWallSplatted = true;
|
|
DemonicsVector2 effectPosition = new DemonicsVector2(player.position.x + ((DemonicsFloat)2.25 * player.flip), player.position.y);
|
|
if (player.flip == 1)
|
|
{
|
|
player.SetEffect("WallSplat", effectPosition, true);
|
|
}
|
|
else
|
|
{
|
|
player.SetEffect("WallSplat", effectPosition, false);
|
|
}
|
|
player.sound = "WallSplat";
|
|
player.enter = true;
|
|
player.animationFrames = 0;
|
|
}
|
|
player.velocity = DemonicsVector2.Zero;
|
|
player.hurtbox.active = false;
|
|
player.animation = "Wallsplat";
|
|
player.animationFrames++;
|
|
ToAirborneState(player);
|
|
}
|
|
private void ToAirborneState(PlayerNetwork player)
|
|
{
|
|
if (player.animationFrames >= 10)
|
|
{
|
|
player.flip *= -1;
|
|
player.hurtbox.active = true;
|
|
player.enter = false;
|
|
player.state = "Airborne";
|
|
}
|
|
}
|
|
} |