Пример #1
0
 public ScorePanel(string Text)
 {
     DoubleBuffered  = true;
     _Text           = Text;
     _TopScoreFont   = new Font(this.Font.Name, 30, FontStyle.Bold);
     _ScoreDataTable = new ScoreDT();
 }
Пример #2
0
        public PlayPanel(int X, int Y)
        {
            DoubleBuffered  = true;
            _XCount         = X;
            _YCount         = Y;
            _MySquareCount  = X * Y;
            _BlockPadding   = 5;
            _PlayBlockWidth = 100;
            _FPS            = 60;

            _SetDestinations = false;
            _NewGame         = true;

            _Direction = Directions.NONE;
            _PlayState = PlayStates.NONE;
            _State     = States.STOPPED;

            _Stopwatch      = new Stopwatch();
            _MoveQueue      = new Queue <Directions>();
            _PlayBlockArray = new PlayBlock[X, Y];

            AddPlayBlocks();

            int ttlWidth  = (((_BlockPadding * 2) + _PlayBlockWidth) * X) + _BlockPadding;
            int ttlHeight = (((_BlockPadding * 2) + _PlayBlockWidth) * Y) + _BlockPadding;

            Width       = ttlWidth;
            Height      = ttlHeight; //ttlWidth;
            Size        = new Size(Width, Height);
            MinimumSize = Size;
            BackColor   = Color.FromArgb(102, 102, 102);

            _MainThread = new Thread(GameLoop);
            _Random     = new Random();

            _DB      = new LocalDB();
            _ScoreDT = new ScoreDT();

            InitializeComponents();
        }