예제 #1
0
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here

            base.Initialize();
            paused = false;
            var position = new Vector2(GraphicsDevice.Viewport.Width / 2, 20);

            board            = new Board();
            nextBlockDisplay = new BlockDisplay();
            holdBlockDisplay = new BlockDisplay();
            scoreboard       = new Scoreboard();

            nextBlockDisplay.Position = position + new Vector2(board.Size.X / 2 + 20, 0);
            holdBlockDisplay.Position = position - new Vector2(board.Size.X, 0);


            scoreboard.Position = position + new Vector2(board.Size.X / 2 + 20, nextBlockDisplay.Size.Y + 200);

            blockQueue     = new Queue <AbstractBlock>();
            board.Position = position - new Vector2(board.Size.X / 2, 0);

            for (int i = 0; i < 5; i++)
            {
                AddBlock();
            }

            currBlock = blockQueue.Dequeue();
            board.UpdateBlock(currBlock);
            _lastUpdate = TimeSpan.FromSeconds(0);
        }
예제 #2
0
        public OutputController()
        {
            this.kinectSensor          = KinectSensor.GetDefault();
            this.coordinateMapper      = kinectSensor.CoordinateMapper;
            this.colorFrameDescription = kinectSensor.ColorFrameSource.FrameDescription;

            this.allBlocks    = new List <Dictionary <string, double> >();
            this.blockDisplay = new BlockDisplay();
        }