Example #1
0
        /// <summary>
        /// Constructs a new screen manager component.
        /// </summary>
        public ScreenManager(Game game)
            : base(game)
        {
            // we must set EnabledGestures before we can query for them, but
            // we don't assume the game wants to read them.
            TouchPanel.EnabledGestures = GestureType.None;

            // Create our music manager component and add it to the game.
            musicManager = new BackgroundMusicManager(game);
            musicManager.PromptGameHasControl += new EventHandler <EventArgs>(musicManager_PromptGameHasControl);
            musicManager.PlaybackFailed       += new EventHandler <EventArgs>(musicManager_PlaybackFailed);
            game.Components.Add(musicManager);
        }
        /// <summary>
        /// Initializes the screen manager component.
        /// </summary>
        public override void Initialize()
        {
            base.Initialize();

            isInitialized = true;

            musicManager = new BackgroundMusicManager(Game);
            musicManager.PromptGameHasControl += MusicManagerPromptGameHasControl;
            musicManager.PlaybackFailed       += MusicManagerPlaybackFailed;
            Game.Components.Add(musicManager);

            Accelerometer.Initialize();

            somaAd              = new SomaAd();
            somaAd.Adspace      = 923881181;
            somaAd.Pub          = 923881181;
            somaAd.AdSpaceWidth = 80;
            somaAd.AdSpaceWidth = 480;
            somaAd.GetAd();
        }