Example #1
0
        public BrickView(Brick brick, GamePanelCallback callback, StackView parent, int width)
        {
            InitializeComponent();
            this.callback = callback;
            this.parent = parent;

            this.brick = brick;
            this.Width = width;

            lbSize.Text = brick.size.ToString();
            this.BackColor = brick.color;
        }
Example #2
0
        private void setupGameView()
        {
            this.flContainer.Controls.Clear();
            int total = game.getLevel();
            double availableWidth = (flContainer.Width - (total*6)) / total;

            // Create Stack view
            int i = 0;
            stackViews = new List<StackView>();
            foreach (Stack stack in game.getStacks()) {
                i++;
                StackView sView = new StackView(stack, this, availableWidth, flContainer.Height);
                stackViews.Add(sView);

                flContainer.Controls.Add(sView);
            }

            timer = new System.Timers.Timer();
            timer.Interval = 1000;
            timer.Elapsed += timer_Elapsed;
            timer.Start();

            game.start();
        }