Beispiel #1
0
        /// <summary>
        /// Initializes a new instance of the TDVBasicGame class.
        /// </summary>
        public TDVBasicGame()
        {
            defaultGame = this;

            this.IsFixedTimeStep = false;
            this.IsMouseVisible = true;
            this.Window.Title = "Happy Birthday";

            this.graphics = new GraphicsDeviceManager(this);
            this.graphics.PreferredBackBufferWidth = Width;
            this.graphics.PreferredBackBufferHeight = Height;
            this.graphics.PreparingDeviceSettings += this.GraphicsDevicePreparingDeviceSettings;
            this.graphics.SynchronizeWithVerticalRetrace = true;
            this.viewPortRectangle = new Rectangle(0,0, Width, Height);

            Content.RootDirectory = "Content";

            for (int i = 0; i < players.Length; i++)
            {
                players[i] = new TDVPlayer();
            }

            // The Kinect sensor will use 640x480 for both streams
            // To make your app handle multiple Kinects and other scenarios,
            // it is recommended to use KinectSensorChooser provided in Microsoft.Kinect.Toolkit
            this.chooser = new KinectChooser(this, ColorImageFormat.RgbResolution640x480Fps30, DepthImageFormat.Resolution640x480Fps30);
            this.Services.AddService(typeof(KinectChooser), this.chooser);

            this.paintersAlgorithmRenderer = new PaintersAlgorithmRenderer(this);

            this.Components.Add(this.chooser);

            this.previousKeyboard = Keyboard.GetState();
        }
Beispiel #2
0
 /// <summary>
 /// This method starts the game cycle.
 /// </summary>
 public static void Main()
 {
     using (TDVBasicGame game = new TDVBasicGame())
     {
         game.Run();
     }
 }