Ejemplo n.º 1
0
        /// <summary>
        /// Should be called in load content.
        /// </summary>
        public void Initialize(GameContext initialContext)
        {
            canvas = new Canvas(graphics, graphicsDevice);
            #if DEBUG
            canvas.DebugMode = true;
            #else
            canvas.DebugMode = false;
            #endif
            // Initialize audio player.
            audioPlayer = new AudioPlayer();
            assets = new AssetManager();
            exitGame = false;

            //launch initialize asynchronously
            //ThreadPool.QueueUserWorkItem(new WaitCallback(InitializeNextContext));
            asyncFinished = true;
            /*Thread t = new Thread(new ThreadStart(InitializeNextContext));
            t.IsBackground = true;
            t.Start();*/

            // load all content
            assets.LoadContent(content, graphicsDevice);
            canvas.LoadContent(assets);
            inputController = new InputController(assets);
            fileManager = new DataCenter(assets);
            InitializeContextComponents(initialContext);
            currentContext = initialContext;

            inputController.Update();

            currentOverlayAlpha = 0;
        }
Ejemplo n.º 2
0
 public virtual void PlayAudio(AudioPlayer audioPlayer)
 {
 }
Ejemplo n.º 3
0
 public virtual void PlayAudio(AudioPlayer audioPlayer)
 {
     if (cycleSound != null)
         audioPlayer.PlayOnSetTrue(cycleSound, t == 0);
     if (selectSound != null)
         audioPlayer.PlayOnSetTrue(selectSound, selected);
 }
Ejemplo n.º 4
0
 public override void PlayAudio(AudioPlayer audioPlayer)
 {
     if (sound != null)
         audioPlayer.PlayOnSetTrue(sound, selected);
 }
Ejemplo n.º 5
0
 public override void PlayAudio(AudioPlayer audioPlayer)
 {
     cursor.PlayAudio(audioPlayer);
 }