예제 #1
0
        private void IncreaseGoldCounter(int i)
        {
            if (IsCollisionCoins == true)
            {
                Canvas.Children.Remove(Coins.UIElements[i]);
                Coins.PointsList[i] = new Point(CommonMetheds.NewPoints(), 10);

                MainWindow.GoldCounter.Text = Convert.ToString(++CoinsCounter);
                IsCollisionCoins            = false;
            }
        }
예제 #2
0
 public virtual void CheckBoundary(Canvas canvas, int i)
 {
     if (PointsList[i].Y > BottomBorder)
     {
         canvas.Children.Remove(UIElements[i]);
         PointsList[i] = new Point(CommonMetheds.NewPoints(), 10);
     }
     else
     {
         UpdatePointsSubject(canvas, i);
     }
 }
예제 #3
0
        public virtual void RmoveItemAndPointsFromCanavas()
        {
            foreach (Image item in UIElements)
            {
                Canvas.Children.Remove(item);
            }

            for (int i = 0; i < PointsList.Count; i++)
            {
                PointsList[i] = new Point(CommonMetheds.NewPoints(), 10);
            }
        }
예제 #4
0
        public override void CreatSubject()
        {
            for (int i = 0; i < NumberOfObjects; i++)
            {
                Image coinImage = new Image
                {
                    Width  = 20,
                    Height = 20,
                    Source = new BitmapImage(new Uri("Images/Coins/Coin.png", UriKind.Relative))
                };
                Xpoint = CommonMetheds.NewPoints();

                Point = new Point(Xpoint, 10);
                Canvas.SetLeft(coinImage, Point.X);
                Canvas.SetTop(coinImage, Point.Y);

                UIElements.Add(coinImage);
                PointsList.Add(Point);
            }
        }
예제 #5
0
        public override void CreatSubject()
        {
            for (int i = 0; i < NumberOfObjects; i++)
            {
                Point = new Point(CommonMetheds.NewPoints(), 10);

                Image policeImage = new Image
                {
                    Width   = 70,
                    Height  = 70,
                    Stretch = Stretch.Fill,
                    Source  = new BitmapImage(new Uri("Images/Obstacle/PoliceCar.png", UriKind.Relative))
                };

                Canvas.SetLeft(policeImage, Point.X);
                Canvas.SetTop(policeImage, Point.Y);

                UIElements.Add(policeImage);
                PointsList.Add(Point);
            }
        }