Exemplo n.º 1
0
 public void Redraw()
 {
     _nusbioMatrix.ScrollPixelLeftDevices(_nusbioMatrix.DeviceCount - 1, 0);
     this._nusbioMatrix.CurrentDeviceIndex = this._deviceIndex;
     if (this._nusbioMatrix.MAX7219Wiring == NusbioMatrix.MAX7219_WIRING_TO_8x8_LED_MATRIX.OriginBottomRightCorner)
     {
         _nusbioMatrix.DrawPixel(CurrentYPosition, CurrentXPosition, true);
     }
     else
     {
         _nusbioMatrix.DrawPixel(CurrentXPosition, CurrentYPosition, true);
     }
     _nusbioMatrix.WriteDisplay(all: true);
     CurrentXPosition += NewDirectionRandomizer();
     if (CurrentXPosition >= _nusbioMatrix.Width - 1)
     {
         CurrentXPosition = _nusbioMatrix.Width - 1;
     }
     if (CurrentXPosition < 0)
     {
         CurrentXPosition = 0;
     }
 }
Exemplo n.º 2
0
        public void Redraw()
        {
            NusbioMatrix.Clear(0, false);
            foreach (var o in _objects)
            {
                o.Move();
                o.Redraw();
            }
            NusbioMatrix.WriteDisplay();

            // The ball reached the wall area
            if (this._mainBall._x == this.Width - 1)
            {
                if (this.Rackette.InYArea(this._mainBall._y))
                {
                    this.PointWon++;
                }
                else
                {
                    this.PointLost++;
                }
            }
        }