Esempio n. 1
0
        public Ball(int posX, int posY, int width, int height, Color color)
        {
            PosX = posX;
            PosY = posY;

            BallDraw = new BallGraphics(width, height, color);
        }
Esempio n. 2
0
        public void DrawObject(object object1)
        {
            string objectMap = (string)object1;

            int[] rnd = JsonConvert.DeserializeObject <int[]>(objectMap);

            this.Dispatcher.Invoke(() =>
            {
                BallGraphics ballGraphics = new BallGraphics(10, 10, Colors.Black);
                CanvasBalls.Children.Add(ballGraphics.ShapeBall);
                Canvas.SetLeft(ballGraphics.ShapeBall, rnd[0]);
                Canvas.SetTop(ballGraphics.ShapeBall, rnd[1]);
                dicObjectsgraphics.Add(rnd[0] + rnd[1], ballGraphics);
            });
        }
Esempio n. 3
0
 public void DrawBall(Player player, BallGraphics ballGraphics)
 {
     Canvas.SetLeft(ballGraphics.ShapeBall, player.position.PosX);
     Canvas.SetTop(ballGraphics.ShapeBall, player.position.PosY);
 }