Beispiel #1
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()
        {
            // TODO: Add your initialization logic here
            theCamera = new Camera(new Vector3(0.5f, 0.5f, 0.5f), 0, GraphicsDevice.Viewport.AspectRatio, 0.05f, 100f);
            theEffect = new BasicEffect(GraphicsDevice);
            theMaze = new Maze(GraphicsDevice);

            base.Initialize();
        }
Beispiel #2
0
        // Contructor
        public NPC(Maze maze)
        {
            theMaze = maze;

            rotation = 180;
            direction = 2;
            timer = 0;

            int startX = random.Next(0, 10);
            int startZ = random.Next(0, 10);

            // Selects a random starting point for the NPC
            //Location = new Vector3((float)startX, 0f, (float)startZ);

            // Use to set NPC location to same spot as player
            Location = new Vector3(0f, 0f, 0f);
        }
Beispiel #3
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()
        {
            #if WINDOWS
                Mouse.SetPosition(GraphicsDevice.Viewport.Width / 2, GraphicsDevice.Viewport.Height / 2);
            #endif

            // TODO: Add your initialization logic here
            collisionToggle = true;

            theCamera = new Camera(new Vector3(0.5f, 0.5f, 0.5f), 0, GraphicsDevice.Viewport.AspectRatio, 0.05f, 100f);
            theEffect = new BasicEffect(GraphicsDevice);
            theMaze = new Maze(GraphicsDevice);
            bgm = true;
            isDay = true;
            isFoggy = false;
            base.Initialize();

            npc = new NPC(theMaze);
        }