Ejemplo n.º 1
0
 void GraphicPart_Tap(object sender, System.Windows.Input.GestureEventArgs e)
 {
   
     AI.Instance.Fight();
     MoveEffect me = new MoveEffect();
     me.From = new Point(0, 0);
     me.To = new Point(0, 1);
     me.Duration = 120;
     me.Mode = EasingMode.EaseIn;
     me.EasingFunction = new CircleEase();
     me.Start((FrameworkElement)this);
     me.Completed += me_Completed;
    
 }
Ejemplo n.º 2
0
 void me_Completed(object sender, EventArgs e)
 {
     MoveEffect me = new MoveEffect();
    
         me.From = new Point(0, 1);
         me.To = new Point(0, 0);
         me.Duration = 120;
         me.Mode = EasingMode.EaseIn;
         me.EasingFunction = new CircleEase();
         me.Start((FrameworkElement)this);
         if (OnTap != null)
         {
             OnTap();
         }
 }
Ejemplo n.º 3
0
        public void Update()
        {
            if (!ended)
            {
                if (ClassicPart != null && FightPart != null)
                {
                    ClassicPart.Visibility = Visibility.Collapsed;
                    FightPart.Visibility = Visibility.Visible;
                    dt.Stop();
                    dt.Interval = TimeSpan.FromMilliseconds(200);
                    dt.Start();
                }
                StaticSprite sprite;
                foreach (UIElement elt in this.Children)
                {
                    if ((sprite = elt as StaticSprite) != null)
                    {
                        float n = MathUtil.Norm(AI.Instance.CurrentNumber.Number, AI.Instance.CurrentLevel.NumberOfTapToDo, 0);
                        int Number = (int)MathUtil.Lerp(0, sprite.Length-1, n);
                        sprite.MoveTo(Number);
                    }
                }
                if (AI.Instance.CurrentNumber.Number <= EndNumber * AI.Instance.CurrentLevel.NumberOfTapToDo)
                {

                    ended = true;
                    MoveEffect me = new MoveEffect();

                    sc.PlaySound("Sounds/tap6.wav");
                    me.From = new Point(0, 10);
                    me.To = new Point(0, 900);
                    me.Duration = 1200;
                    me.Mode = EasingMode.EaseIn;
                    me.EasingFunction = new CircleEase();
                    me.Start((FrameworkElement)this.Children.FirstOrDefault());
                    me.Completed += me_CompletedEnd;
                }
            }
        }
Ejemplo n.º 4
0
        public void RunExplosion()
        {

            foreach (Path pixel in ExplosionEffect.Children)
            {
                MoveEffect me = new MoveEffect();
                double toLeft = RandomNumber.Next(-500, 500);
                double toTop =RandomNumber.Next(-500, 500);
               
                me.From = new Point(0, 0);
                if (toLeft < 0 && toLeft > -300)
                {
                    toLeft -= 500;
                }
                if (toLeft > 0 && toLeft < 300)
                {
                    toLeft += 500;
                }
                if (toTop < 0 && toTop > -300)
                {
                    toTop -= 500;
                }
                if (toTop > 0 && toTop < 300)
                {
                    toTop += 500;
                }
                me.To = new Point(toLeft, toTop);

                me.EasingFunction = new CircleEase();
                me.Duration = 2000;
                me.Mode = EasingMode.EaseIn;
                me.Start(pixel);

            }
        }