Exemplo n.º 1
0
        public SchmupGame()
        {
            Window.Title = "Schmup";
            Window.AllowUserResizing = false;
            IsMouseVisible = false;

            graphics = new GraphicsDeviceManager(this);
            graphics.SynchronizeWithVerticalRetrace = false;
            graphics.PreferredBackBufferWidth = 1280;
            graphics.PreferredBackBufferHeight = 720;
            graphics.IsFullScreen = false;

            // Set the framerate at 62.5 fps (i.e. about 60 fps)
            IsFixedTimeStep = true;
            TargetElapsedTime = new TimeSpan(0, 0, 0, 0, 16);

            Content.RootDirectory = "Content";

            InputState = new InputState();

            MainMenu = new MainMenu(this);
            Components.Add(MainMenu);
            OptionsMenu = new OptionsMenu(this);
            Components.Add(OptionsMenu);

            ScoreManager = new ScoreManager(this);
            Components.Add(ScoreManager);

            Level = new Level(this);
            Components.Add(Level);

            #if DEBUG
            FrameRateCounter frameRateCounter = new FrameRateCounter(this);
            frameRateCounter.DrawOrder = 101;
            Components.Add(frameRateCounter);
            ComponentsTracer componentsTracer = new ComponentsTracer(this);
            componentsTracer.DrawOrder = 102;
            componentsTracer.AddComponent("Main Menu", MainMenu);
            componentsTracer.AddComponent("Options Menu", OptionsMenu);
            componentsTracer.AddComponent("Score Manager", ScoreManager);
            componentsTracer.AddComponent("Level", Level);
            Components.Add(componentsTracer);
            #endif
        }
Exemplo n.º 2
0
 public LevelTracer(Game game, Level level)
     : base(game)
 {
     this.level = level;
 }