Beispiel #1
0
        public static void ActivateFlightBehavior(SpiritWalkingPlayer myplayer)
        {
            myplayer.IntendedFlightVelocity = SpiritWalkFlightLogic.DefaultFlightHeading;

            int projWho = SpiritWalkFlightLogic.CreateSpiritBall(myplayer);

            myplayer.FlightProjectile = Main.projectile[projWho];
        }
        ////////////////

        public static void UpdateWalk(SpiritWalkingPlayer myplayer)
        {
            SpiritWalkFlightLogic.UpdateSpeedChanges(myplayer);

            if (myplayer.FlightProjectile?.active != true)
            {
                int projWho = SpiritWalkFlightLogic.CreateSpiritBall(myplayer);
                myplayer.FlightProjectile = Main.projectile[projWho];
            }

            if (myplayer.FlightProjectile?.active == true)
            {
                myplayer.player.Center   = myplayer.FlightProjectile.Center;
                myplayer.player.velocity = default;
            }
            //float accel = 0.1f;
            //myplayer.player.velocity = Vector2.Lerp( myplayer.player.velocity, myplayer.FlightDirection, accel );
        }