//only for testing public
 public void RecreateScanLines()
 {
     foreach (FrameworkElement scanLine in _scanLines)
     {
         if (_sprites.Contains(scanLine))
         {
             _sprites.Remove(scanLine);
         }
     }
     _scanLines.Clear();
     for (int y = 0; y < 300; y += 2)
     {
         FrameworkElement scanLine = InvadersHelper.ScanLineFactory(y, 400, Scale);
         _scanLines.Add(scanLine);
         _sprites.Add(scanLine);
     }
 }
 private void RecreateScanLines()
 {
     foreach (var scanLine in _scanLines)
     {
         if (_sprites.Contains(scanLine))
         {
             _sprites.Remove(scanLine);
         }
     }
     _scanLines.Clear();
     for (var y = 0; y < 300; y += 2)
     {
         var scanLine = InvadersHelper.ScanLineFactory(y, 400, Scale);
         _scanLines.Add(scanLine);
         _sprites.Add(scanLine);
     }
 }
Beispiel #3
0
 private void RecreateScanLines()
 {
     foreach (FrameworkElement scanLine in _scanLines)
     {
         if (_sprites.Contains(scanLine))
         {
             _sprites.Remove(scanLine);
         }
     }
     _scanLines.Clear();
     for (int y = 0; y < 300; y += 4)
     {
         FrameworkElement scanLine = InvadersHelper.ScanLineFactory();
         _scanLines.Add(scanLine);
         _sprites.Add(scanLine);
         InvadersHelper.ResizeElement(scanLine, 400 * Scale, 1 * Scale);
         InvadersHelper.RepositionElement(scanLine, 0, y * Scale);
     }
 }