public Ball(int posX, int posY, int width, int height, Color color) { PosX = posX; PosY = posY; BallDraw = new BallGraphics(width, height, color); }
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); }); }
public void DrawBall(Player player, BallGraphics ballGraphics) { Canvas.SetLeft(ballGraphics.ShapeBall, player.position.PosX); Canvas.SetTop(ballGraphics.ShapeBall, player.position.PosY); }