コード例 #1
0
 public AlertScreen(bGame game, bGameState nextWorld, Func<GameTime, SpriteBatch, Matrix, int> renderAlert)
     : base()
 {
     this.game = game;
     this.renderAlert = renderAlert;
     this.nextWorld = nextWorld;
 }
コード例 #2
0
 public Title(bGame game, bGameState nextWorld = null)
     : base()
 {
     this.game = game;
     if (nextWorld == null)
         nextWorld = new Ring(game);
     this.nextWorld = nextWorld;
 }
コード例 #3
0
        public void actuallyChangeWorld(bGameState newWorld)
        {
            if (newWorld != null)
            {
                if (world != null)
                    world.end();

                world = newWorld;
                world.game = this;

                newWorld.init();

                requestedWorldChange = false;
                nextWorld = null;
            }
            else
            {
                Console.WriteLine("An invalid attemp to change world occured:");
                Console.WriteLine("Request: " + (requestedWorldChange ? "issued " : "not issued; ") +
                                  "Valid instance: " + ((nextWorld != null) ? "yes" : "no"));
            }
        }
コード例 #4
0
 public void changeWorld(bGameState newWorld, Transition transition)
 {
     if (world == null)
         actuallyChangeWorld(newWorld);
     else
     {
         nextWorld = newWorld;
         requestedWorldChange = true;
         requestedTransition = transition;
     }
 }
コード例 #5
0
 public void changeWorld(bGameState newWorld)
 {
     changeWorld(newWorld, defaultTransition());
 }
コード例 #6
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 (!dataManager.loadGame())
                dataManager.startNewGame();

            // TODO: Create Initial Level
            worldMap = new GameWorld(this);
            changeWorld(worldMap);

            base.Initialize();
        }