Exemple #1
0
        public Player(PlayerIndex number, SpriteFont font, KinectControls kinectControls = null)
        {
            if (kinectControls != null)
            {
                _kinectControls = kinectControls;
            }

            this.ActorNumber = number;
            this.Score       = 0;
            this._font       = font;
        }
Exemple #2
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            this.graphics.PreferredBackBufferWidth  = SCREEN_WIDTH;
            this.graphics.PreferredBackBufferHeight = SCREEN_HEIGHT;
            this.graphics.ApplyChanges();

            entities = new List <IEntity2D>();
            players  = new List <Player>();
            state    = new GameStateManager();

            if (KinectSensor.KinectSensors.Count > 0)
            {
                kinectControls = new KinectControls(this);
            }

            base.Initialize();
        }