コード例 #1
0
ファイル: Level.cs プロジェクト: MunkiPhD/FrontierMonkeys
        public Level(IServiceProvider serviceProvider, int levelIndex, Player thePlayer)
        {
            // create the content manager
            this.content = new ContentManager(serviceProvider, "Content");

            // load the layers for now
            _layers = new Layer[1];
            _layers[0] = new Layer(content, "Backgrounds/Layer0");
            // _layers[1] = new Layer(content, "Backgrounds/Layer1");
            // _layers[2] = new Layer(content, "Backgrounds/Layer2");
            this.player = thePlayer;
        }
コード例 #2
0
        /// <summary>
        /// Load graphics content for the game.
        /// </summary>
        public override void Activate(bool instancePreserved)
        {
            if (!instancePreserved) {
                if (content == null)
                    content = new ContentManager(ScreenManager.Game.Services, "Content");

                gameFont = content.Load<SpriteFont>("gamefont");

                // A real game would probably have more content than this sample, so
                // it would take longer to load. We simulate that by delaying for a
                // while, giving you a chance to admire the beautiful loading screen.
                //Thread.Sleep(1000);

                //mine
                //input = new InputHandler();
                player = new Player(ScreenManager.Game); //, input);
                entityList.Add(player);

                // once the load has finished, we use ResetElapsedTime to tell the game's
                // timing mechanism that we have just finished a very long frame, and that
                // it should not try to catch up.
                ScreenManager.Game.ResetElapsedTime();

                LoadNextLevel();
            }
        }