Exemple #1
0
        private Model model; //player's 3D model

        #endregion Fields

        #region Constructors

        //Constructor for the player class
        public Player(Model newmodel = null)
        {
            model = newmodel;
            position = new Vector3(0,0,0);
            crosshair_position = new Vector2(settings.Default.ScreenWidth/2,settings.Default.ScreenHeight/2);

            //Initailze kinect if needed
            if (settings.Default.EnableKinect) {
                kinect = new Kinect();
                kinect.initialize();
            }
        }
Exemple #2
0
 //Initialize Function
 protected override void Initialize()
 {
     //initialize kinect stuff if needed
     if (Defualt.Default.UsingKinect) {
         kinect = new Kinect();
         kinect.initialize();
     }
     base.Initialize();
 }
Exemple #3
0
 public virtual void Initialize()
 {
     kinect = new Kinect();
     kinect.initialize();
     Terminated = false;
 }
Exemple #4
0
        //load content
        public void LoadContent(ContentManager Content)
        {
            texture = Content.Load<Texture2D>("Artwork/player");
            bulletTexture = Content.Load<Texture2D>("Artwork/playerbullet");
            sm.LoadContent(Content);

            //if (Defualt.Default.UsingKinect) {
                kinect = new Kinect();
                kinect.initialize();
            //}
        }
        /// <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()
        {
            IsMouseVisible = true;

            Rectangle window = new Rectangle(0, 0, GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height);

            games = new List<GameBase>();
            loadedGame = -1;

            Game1 game1 = new Game1(Content, window);
            games.Add((GameBase)game1);

            //Game2 game2 = new Game2(Content, window);
            //games.Add((GameBase)game2);

            Tetris tetris = new Tetris(Content, window);
            games.Add((GameBase)tetris);

            buttonFont = Content.Load<SpriteFont>("buttonText");

            //games.Add(new Game1(Content));
            button1 = new Button(GraphicsDevice, new Rectangle(100, 10, 300, 100), Color.DarkGreen, Color.Green, buttonFont, "GAME 1");
            button2 = new Button(GraphicsDevice, new Rectangle(100, 120, 300, 100), Color.Blue, Color.SkyBlue, buttonFont, "Tetris");
            Quit = new Button(GraphicsDevice, new Rectangle(100, 230, 300, 100), Color.Crimson, Color.OrangeRed, buttonFont, "QUIT");
            endgame = new Button(GraphicsDevice, new Rectangle(100, 10, 300, 100), Color.Crimson, Color.OrangeRed, buttonFont, "ENDGAME");

            kinect = new Kinect();
            kinect.initialize();

            base.Initialize();
        }