Esempio n. 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
            curMode = new LevelEditorMode(graphics, Content, spriteBatch, basicEffect);
            curMode.LoadContent();
            IsMouseVisible = true;

            base.Initialize();
        }
Esempio n. 2
0
        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            // TODO: Add your update logic here

            // state switching
            if (curMode.SwitchTo != null)
            {
                curMode.UnloadContent();
                curMode = curMode.SwitchTo;
                curMode.LoadContent();
            }

            curMode.Update(gameTime);

            base.Update(gameTime);
        }