示例#1
0
        public override void Initialize(IApplication application)
        {
            base.Initialize(application);

            GameStorage gameStorage;

            if (WaveServices.Storage.Exists <GameStorage>())
            {
                gameStorage = WaveServices.Storage.Read <GameStorage>();
            }
            else
            {
                gameStorage = new GameStorage();
            }

            Catalog.RegisterItem(gameStorage);

            ViewportManager vm = WaveServices.ViewportManager;

            vm.Activate(1024, 768, ViewportManager.StretchMode.UniformToFill);

            ScreenContext screenContext = new ScreenContext(new GamePlayScene())
            {
                Behavior = ScreenContextBehaviors.DrawInBackground
            };

            WaveServices.ScreenContextManager.To(screenContext);
        }
示例#2
0
        public override void Initialize(IApplication application)
        {
            base.Initialize(application);

            GameStorage gameStorage;

            if (WaveServices.Storage.Exists <GameStorage>())
            {
                gameStorage = WaveServices.Storage.Read <GameStorage>();
            }
            else
            {
                gameStorage = new GameStorage();
            }

            Catalog.RegisterItem(gameStorage);

            application.Adapter.DefaultOrientation    = DisplayOrientation.Portrait;
            application.Adapter.SupportedOrientations = DisplayOrientation.Portrait;

            ViewportManager vm = WaveServices.ViewportManager;

            vm.Activate(768, 1024, ViewportManager.StretchMode.Uniform);


            ScreenContext screenContext = new ScreenContext(new MainMenuScene());

            // Play background music
            WaveServices.MusicPlayer.Play(new MusicInfo(WaveContent.Assets.Sounds.bg_music_mp3));
            WaveServices.MusicPlayer.IsRepeat = true;

            WaveServices.ScreenContextManager.To(screenContext);
        }
示例#3
0
文件: Game.cs 项目: frodo5654/Samples
        public override void Initialize(IApplication application)
        {
            base.Initialize(application);

            ViewportManager vm = WaveServices.GetService <ViewportManager>();

            vm.Activate(800, 480, ViewportManager.StretchMode.Fill);

            WaveServices.ScreenContextManager.To(new ScreenContext(new MyScene()));
        }
示例#4
0
        public override void Initialize(IApplication application)
        {
            base.Initialize(application);

            // ViewportManager is used to automatically adapt resolution to fit screen size
            ViewportManager vm = WaveServices.ViewportManager;

            vm.Activate(1280, 720, ViewportManager.StretchMode.UniformToFill);

            ScreenContext screenContext = new ScreenContext(new MyScene(), new JoystickScene());

            WaveServices.ScreenContextManager.To(screenContext);
        }
示例#5
0
        public override void Initialize(IApplication application)
        {
            base.Initialize(application);

            this.RegisterServices();

            ViewportManager vm = WaveServices.ViewportManager;

            vm.Activate(1280, 720, ViewportManager.StretchMode.Uniform);
            ScreenContext screenContext = new ScreenContext(new MainScene());

            WaveServices.ScreenContextManager.To(screenContext);
        }
示例#6
0
文件: Game.cs 项目: maral/Eyed
        public override void Initialize(IApplication application)
        {
            base.Initialize(application);

            // ViewportManager is used to automatically adapt resolution to fit screen size
            ViewportManager vm = WaveServices.ViewportManager;

            vm.Activate(WIDTH, HEIGHT, ViewportManager.StretchMode.Uniform);

            ScreenContext screenContext = new ScreenContext(new MenuScene());

            WaveServices.ScreenContextManager.To(screenContext);
        }
示例#7
0
        public override void Initialize(IApplication application)
        {
            base.Initialize(application);

            application.Adapter.DefaultOrientation    = DisplayOrientation.Portrait;
            application.Adapter.SupportedOrientations = DisplayOrientation.Portrait;

#if ANDROID
            InitializeAndRegisterSocialService();
#endif

            // Load storage game data
            GameStorage gameStorage;
            if (WaveServices.Storage.Exists <GameStorage>())
            {
                gameStorage = WaveServices.Storage.Read <GameStorage>();
            }
            else
            {
                gameStorage = new GameStorage();
            }

            Catalog.RegisterItem(gameStorage);

            // Register the SoundManager service
            WaveServices.RegisterService <SoundManager>(new SoundManager());

            // Use ViewportManager to ensure scaling in all devices
            ViewportManager vm = WaveServices.ViewportManager;
            vm.Activate(768, 1024, ViewportManager.StretchMode.Uniform);

            var backContext = new ScreenContext("BackContext", new BackgroundScene())
            {
                Behavior = ScreenContextBehaviors.DrawInBackground | ScreenContextBehaviors.UpdateInBackground
            };

            var mainContext = new ScreenContext(new MainMenuScene());


            WaveServices.ScreenContextManager.Push(backContext);
            WaveServices.ScreenContextManager.Push(mainContext);

            // Play music
            WaveServices.MusicPlayer.Play(new MusicInfo(WaveContent.Assets.Sounds.bg_music_mp3));
            WaveServices.MusicPlayer.Volume   = 1.0f;
            WaveServices.MusicPlayer.IsRepeat = true;
        }
示例#8
0
        public override void Initialize(IApplication application)
        {
            base.Initialize(application);

            // Load storage game data
            GameStorage gameStorage;

            if (WaveServices.Storage.Exists <GameStorage>())
            {
                gameStorage = WaveServices.Storage.Read <GameStorage>();
            }
            else
            {
                gameStorage = new GameStorage();
            }

            Catalog.RegisterItem(gameStorage);

            // Register the SoundManager service
            WaveServices.RegisterService <SoundManager>(new SoundManager());

            // Set portrait orientation in WP
            if (WaveServices.Platform.PlatformType == PlatformType.WindowsPhone)
            {
                application.Adapter.DefaultOrientation    = DisplayOrientation.Portrait;
                application.Adapter.SupportedOrientations = DisplayOrientation.Portrait;
            }

            // Use ViewportManager to ensure scaling in all devices
            ViewportManager vm = WaveServices.ViewportManager;

            vm.Activate(768, 1024, ViewportManager.StretchMode.Uniform);

            // Load heavy assets to avoid breaks during gameplay
            this.LoadHeavyAssets();

            var backContext = new ScreenContext("BackContext", new BackgroundScene())
            {
                Behavior = ScreenContextBehaviors.DrawInBackground | ScreenContextBehaviors.UpdateInBackground
            };
            var mainContext = new ScreenContext(new MainMenuScene());

            WaveServices.ScreenContextManager.Push(backContext);
            WaveServices.ScreenContextManager.Push(mainContext);
        }
示例#9
0
        public override void Initialize(IApplication application)
        {
            base.Initialize(application);

            ViewportManager vm = WaveServices.GetService <ViewportManager>();

            vm.Activate(800, 480, ViewportManager.StretchMode.Uniform);

            this.analyticsManager = new AnalyticsManager(application.Adapter);
            WaveServices.RegisterService <AnalyticsManager>(analyticsManager);

            this.analyticsManager.SetAnalyticsSystem(new LocalyticsInfo("492098e861d94597fd5f0cf-e9b821a6-7d17-11e3-9836-009c5fda0a25"));
            this.analyticsManager.Open();
            this.analyticsManager.Upload();

            ScreenContext screenContext = new ScreenContext(new MyScene());

            WaveServices.ScreenContextManager.To(screenContext);
        }
示例#10
0
文件: Game.cs 项目: sgrizan/Samples
        /// <summary>
        /// Initializes the game according to the passed application (thus adapter).
        ///             The adapter implementation depends on the while-running platform.
        ///             Such method acts as the bridge between the game and the final hardware.
        /// </summary>
        /// <param name="application">The application (adapter).</param>
        public override void Initialize(IApplication application)
        {
            base.Initialize(application);

            // ViewportManager is used to automatically adapt resolution to fit screen size
            ViewportManager vm = WaveServices.ViewportManager;

            vm.Activate(1920, 1080, ViewportManager.StretchMode.Uniform);

            // Register Kinect Service Wave Engine Extension
            WaveServices.RegisterService(new KinectService());

            ScreenContext screenContext = new ScreenContext(new KinectScene())
            {
                Behavior = ScreenContextBehaviors.DrawInBackground
                           | ScreenContextBehaviors.UpdateInBackground
            };

            WaveServices.ScreenContextManager.Push(screenContext);
            WaveServices.ScreenContextManager.Push(new ScreenContext(new StartScene()), new CrossFadeTransition(TimeSpan.FromSeconds(3.0f)));
        }