Exemplo n.º 1
0
 // Token: 0x06000040 RID: 64 RVA: 0x00003074 File Offset: 0x00001274
 public static void Update(Graphics g)
 {
     Time.TickTime();
     if (Program.GetAsyncKeyState(Keys.Escape) != 0)
     {
         MainGame.curQuitAlpha += 0.00216666679f;
     }
     else
     {
         MainGame.curQuitAlpha -= 0.0166666675f;
     }
     MainGame.curQuitAlpha = SamMath.Clamp(MainGame.curQuitAlpha, 0f, 1f);
     if (MainGame.curQuitAlpha > 0.2f)
     {
         float num   = (MainGame.curQuitAlpha - 0.2f) / 0.8f;
         int   num2  = (int)SamMath.Lerp(-15f, 10f, Easings.ExponentialEaseOut(num * 2f));
         SizeF sizeF = g.MeasureString("Continue Holding ESC to evict goose", MainGame.showCurQuitFont, int.MaxValue);
         g.FillRectangle(Brushes.LightBlue, new Rectangle(5, num2 - 5, (int)sizeF.Width + 10, (int)sizeF.Height + 10));
         g.FillRectangle(Brushes.LightPink, new Rectangle(5, num2 - 5, (int)SamMath.Lerp(0f, sizeF.Width + 10f, num), (int)sizeF.Height + 10));
         SolidBrush solidBrush = new SolidBrush(Color.FromArgb(255, (int)(256f * MainGame.curQuitAlpha), (int)(256f * MainGame.curQuitAlpha), (int)(256f * MainGame.curQuitAlpha)));
         g.DrawString("Continue holding ESC to evict goose", MainGame.showCurQuitFont, solidBrush, 10f, (float)num2);
         solidBrush.Dispose();
     }
     if (MainGame.curQuitAlpha > 0.99f)
     {
         Application.Exit();
     }
     TheGoose.Tick();
     TheGoose.Render(g);
 }
Exemplo n.º 2
0
 public static void Update(Graphics g)
 {
     Time.TickTime();
     if (Program.GetAsyncKeyState(Keys.Escape) != (short)0)
     {
         MainGame.curQuitAlpha += 0.002166667f;
     }
     else
     {
         MainGame.curQuitAlpha -= 0.01666667f;
     }
     MainGame.curQuitAlpha = SamMath.Clamp(MainGame.curQuitAlpha, 0.0f, 1f);
     if ((double)MainGame.curQuitAlpha > 0.200000002980232)
     {
         float p     = (float)(((double)MainGame.curQuitAlpha - 0.200000002980232) / 0.800000011920929);
         int   num   = (int)SamMath.Lerp(-15f, 10f, Easings.ExponentialEaseOut(p * 2f));
         SizeF sizeF = g.MeasureString("Continue Holding ESC to evict goose", MainGame.showCurQuitFont, int.MaxValue);
         g.FillRectangle(Brushes.LightBlue, new Rectangle(5, num - 5, (int)sizeF.Width + 10, (int)sizeF.Height + 10));
         g.FillRectangle(Brushes.LightPink, new Rectangle(5, num - 5, (int)SamMath.Lerp(0.0f, sizeF.Width + 10f, p), (int)sizeF.Height + 10));
         SolidBrush solidBrush = new SolidBrush(Color.FromArgb((int)byte.MaxValue, (int)(256.0 * (double)MainGame.curQuitAlpha), (int)(256.0 * (double)MainGame.curQuitAlpha), (int)(256.0 * (double)MainGame.curQuitAlpha)));
         g.DrawString("Continue holding ESC to evict goose", MainGame.showCurQuitFont, (Brush)solidBrush, 10f, (float)num);
         solidBrush.Dispose();
     }
     if ((double)MainGame.curQuitAlpha > 0.990000009536743)
     {
         Application.Exit();
     }
     TheGoose.Tick();
     TheGoose.Render(g);
 }
Exemplo n.º 3
0
        protected override void OnUpdate(float dt)
        {
            timer.Update(dt);
            if (timer.HasElapsed())
            {
                Kill();
            }

            float alpha = timer.Elapsed / time;

            alpha = MathHelper.Clamp(alpha, 0, 1);
            Vector2 pos  = entity.GetComponent <TransformComponent>().Position;
            float   beta = Easings.ExponentialEaseOut(alpha);

            pos.Y = MathHelper.Lerp(1.25f * CVars.Get <float>("screen_height") / 2, 0, beta);
            entity.GetComponent <TransformComponent>().Move(pos - entity.GetComponent <TransformComponent>().Position);
        }
Exemplo n.º 4
0
    // Token: 0x06000001 RID: 1 RVA: 0x00002050 File Offset: 0x00000250
    public static float Interpolate(float p, Easings.Functions function)
    {
        switch (function)
        {
        default:
            return(Easings.Linear(p));

        case Easings.Functions.QuadraticEaseIn:
            return(Easings.QuadraticEaseIn(p));

        case Easings.Functions.QuadraticEaseOut:
            return(Easings.QuadraticEaseOut(p));

        case Easings.Functions.QuadraticEaseInOut:
            return(Easings.QuadraticEaseInOut(p));

        case Easings.Functions.CubicEaseIn:
            return(Easings.CubicEaseIn(p));

        case Easings.Functions.CubicEaseOut:
            return(Easings.CubicEaseOut(p));

        case Easings.Functions.CubicEaseInOut:
            return(Easings.CubicEaseInOut(p));

        case Easings.Functions.QuarticEaseIn:
            return(Easings.QuarticEaseIn(p));

        case Easings.Functions.QuarticEaseOut:
            return(Easings.QuarticEaseOut(p));

        case Easings.Functions.QuarticEaseInOut:
            return(Easings.QuarticEaseInOut(p));

        case Easings.Functions.QuinticEaseIn:
            return(Easings.QuinticEaseIn(p));

        case Easings.Functions.QuinticEaseOut:
            return(Easings.QuinticEaseOut(p));

        case Easings.Functions.QuinticEaseInOut:
            return(Easings.QuinticEaseInOut(p));

        case Easings.Functions.SineEaseIn:
            return(Easings.SineEaseIn(p));

        case Easings.Functions.SineEaseOut:
            return(Easings.SineEaseOut(p));

        case Easings.Functions.SineEaseInOut:
            return(Easings.SineEaseInOut(p));

        case Easings.Functions.CircularEaseIn:
            return(Easings.CircularEaseIn(p));

        case Easings.Functions.CircularEaseOut:
            return(Easings.CircularEaseOut(p));

        case Easings.Functions.CircularEaseInOut:
            return(Easings.CircularEaseInOut(p));

        case Easings.Functions.ExponentialEaseIn:
            return(Easings.ExponentialEaseIn(p));

        case Easings.Functions.ExponentialEaseOut:
            return(Easings.ExponentialEaseOut(p));

        case Easings.Functions.ExponentialEaseInOut:
            return(Easings.ExponentialEaseInOut(p));

        case Easings.Functions.ElasticEaseIn:
            return(Easings.ElasticEaseIn(p));

        case Easings.Functions.ElasticEaseOut:
            return(Easings.ElasticEaseOut(p));

        case Easings.Functions.ElasticEaseInOut:
            return(Easings.ElasticEaseInOut(p));

        case Easings.Functions.BackEaseIn:
            return(Easings.BackEaseIn(p));

        case Easings.Functions.BackEaseOut:
            return(Easings.BackEaseOut(p));

        case Easings.Functions.BackEaseInOut:
            return(Easings.BackEaseInOut(p));

        case Easings.Functions.BounceEaseIn:
            return(Easings.BounceEaseIn(p));

        case Easings.Functions.BounceEaseOut:
            return(Easings.BounceEaseOut(p));

        case Easings.Functions.BounceEaseInOut:
            return(Easings.BounceEaseInOut(p));
        }
    }
Exemplo n.º 5
0
 float InterpolateFromTarget(float t)
 {
     timer += Time.deltaTime / TotalTime;
     return(Mathf.Lerp(from, t, Easings.ExponentialEaseOut(timer)));
 }