Пример #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

            Resources.init(Content);
            //states.push(new GameState(states, Content.Load<SharedContent.LevelModel>("Levels/DemoLevel")));
            states.push(new MainMenu(states, Content));
            renderer = new Renderer(gdm, Content);
            base.Initialize();
        }
Пример #2
0
 public void tick(float timedelta)
 {
     if (Controller.RecentlyPressed(PlayerIndex.One, Buttons.Start, 0.5f))
     {
         //states.push(new GameState(states, levelProtos[0]));
         foreach (PlayerIndex controller in controllers)
         {
             Console.WriteLine("Controller: {0}", controller);
             addPlayer(controller);
         }
         states.push(GameState.Create(states, levelProtos[selectedLevel], players));
         players.Clear();
     }
     if (Controller.RecentlyPressed(PlayerIndex.One, Buttons.Back, 0.5f))
     {
         states.pop();
     }
     //if (GamePad.GetState(PlayerIndex.One).IsButtonDown(Buttons.Back))
     //    states.pop();
 }