internal static FrameworkElement InvaderControlFactory(Invader invader, double scale) { IEnumerable <string> imageNames = CreateImageList(invader.InvaderType); AnimatedImage invaderControl = new AnimatedImage(imageNames, TimeSpan.FromSeconds(.75)); invaderControl.Width = invader.Size.Width * scale; invaderControl.Height = invader.Size.Height * scale; SetCanvasLocation(invaderControl, invader.Location.X * scale, invader.Location.Y * scale); return(invaderControl); }
internal static FrameworkElement PlayerControlFactory(Player player, double scale) { AnimatedImage playerControl = new AnimatedImage(new List <string>() { "player.png", "player.png" }, TimeSpan.FromSeconds(1)); // *? playerControl.Width = player.Size.Width * scale; playerControl.Height = player.Size.Height * scale; SetCanvasLocation(playerControl, player.Location.X * scale, player.Location.Y * scale); return(playerControl); // ? }