private void DrawEnemy(GameObject enemy) { var ell = new Ellipse { Width = enemy.Bouns.Width, Height = enemy.Bouns.Height, Fill=Brushes.Brown, StrokeThickness=2 }; Canvas.SetLeft(ell, enemy.Position.Left); Canvas.SetTop(ell, enemy.Position.Top); this.canvas.Children.Add(ell); }
private void DrawProjectile(GameObject projectile) { var rect = new Rectangle { Width = projectile.Bouns.Width, Height = projectile.Bouns.Height, Fill = Brushes.Red, StrokeThickness = 2 }; Canvas.SetLeft(rect, projectile.Position.Left); Canvas.SetTop(rect, projectile.Position.Top); this.canvas.Children.Add(rect); }
private void DrawBatwing(GameObject batwing) { Image image = new Image(); BitmapImage batwingImageSource = new BitmapImage(); batwingImageSource.BeginInit(); batwingImageSource.UriSource = new Uri("/Images/batwing.png",UriKind.Relative); batwingImageSource.EndInit(); image.Source = batwingImageSource; image.Width = batwing.Bouns.Width; image.Height = batwing.Bouns.Height; Canvas.SetLeft(image, batwing.Position.Left); Canvas.SetTop(image, batwing.Position.Top); this.canvas.Children.Add(image); }