Beispiel #1
0
 public AudioManager(ScreenManager sm)
 {
     screenManager = sm;
     songs = new List<string>(new String[] {"OST","first"});
     currentSound = sm.Game.Content.Load<SoundEffect>("sound/theme");
     spooky = sm.Game.Content.Load<SoundEffect>("sound/spooky");
 }
Beispiel #2
0
        public Game1(GameState state)
        {
            this.state = state;
            GameTime gameTime = new GameTime();
            graphics = new GraphicsDeviceManager(this);
            this.graphics.PreferredBackBufferWidth = 1280;
            this.graphics.PreferredBackBufferHeight = 720;
            this.graphics.IsFullScreen = false;
            Content.RootDirectory = "Content";

            //Create a new instance of the Screen Manager
            screenManager = new ScreenManager(this);
            Components.Add(screenManager);

            //Add two new screens
            screenManager.AddScreen(new BackgroundScreen());
            if (!state.gameStarted)
            {
                screenManager.AddScreen(new MainMenuScreen());
                state.gameStarted = true;
            }
            else
            {
                screenManager.AddScreen(new GameplayScreen(this, state));
            }
        }