Example #1
0
        public override void DidFinishLaunching(NSNotification notification)
        {
            // Start the progress indicator animation.
            loadingProgressIndicator.StartAnimation (this);

            gameLogo.Image = new NSImage (NSBundle.MainBundle.PathForResource ("logo", "png"));
            archerButton.Image = new NSImage (NSBundle.MainBundle.PathForResource ("button_archer", "png"));
            warriorButton.Image = new NSImage (NSBundle.MainBundle.PathForResource ("button_warrior", "png"));

            // The size for the primary scene - 1024x768 is good for OS X and iOS.
            var size = new CGSize (1024, 768);
            // Load the shared assets of the scene before we initialize and load it.
            scene = new AdventureScene (size);

            scene.LoadSceneAssetsWithCompletionHandler (() => {
                scene.Initialize ();
                scene.ScaleMode = SKSceneScaleMode.AspectFill;

                SKView.PresentScene (scene);

                loadingProgressIndicator.StopAnimation (this);
                loadingProgressIndicator.Hidden = true;

                NSAnimationContext.CurrentContext.Duration = 2.0f;
                ((NSButton)archerButton.Animator).AlphaValue = 1.0f;
                ((NSButton)warriorButton.Animator).AlphaValue = 1.0f;

                scene.ConfigureGameControllers();
            });

            SKView.ShowsFPS = true;
            SKView.ShowsDrawCount = true;
            SKView.ShowsNodeCount = true;
        }
Example #2
0
        void BuildScence()
        {
            loadingProgressIndicator.StartAnimating ();

            CGSize size = View.Bounds.Size;
            // On iPhone/iPod touch we want to see a similar amount of the scene as on iPad.
            // So, we set the size of the scene to be double the size of the view, which is
            // the whole screen, 3.5- or 4- inch. This effectively scales the scene to 50%.
            if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) {
                size.Height *= 2;
                size.Width *= 2;
            }

            scene = new AdventureScene (size);

            scene.LoadSceneAssetsWithCompletionHandler (() => {
                scene.Initialize();
                scene.ScaleMode = SKSceneScaleMode.AspectFill;
                scene.ConfigureGameControllers();

                loadingProgressIndicator.StopAnimating();
                loadingProgressIndicator.Hidden = true;

                SKView.PresentScene(scene);

                UIView.Animate(2, 0, UIViewAnimationOptions.CurveEaseInOut, ()=> {
                    archerButton.Alpha = 1;
                    warriorButton.Alpha = 1;
                }, null);
            });

            SKView.ShowsFPS = true;
            SKView.ShowsDrawCount = true;
            SKView.ShowsNodeCount = true;
        }
Example #3
0
    protected override void Awake()
    {
        base.Awake();
        s_instance                   = this;
        this.m_CurrentSubScene       = null;
        this.m_TransitionOutSubScene = null;
        AdventureConfig config = AdventureConfig.Get();

        config.OnAdventureSceneAwake();
        config.AddSubSceneChangeListener(new AdventureConfig.SubSceneChange(this.OnSubSceneChange));
        config.AddSelectedModeChangeListener(new AdventureConfig.SelectedModeChange(this.OnSelectedModeChanged));
        config.AddAdventureModeChangeListener(new AdventureConfig.AdventureModeChange(this.OnAdventureModeChanged));
        this.m_StartupAssetLoads++;
        bool @bool = Options.Get().GetBool(Option.HAS_SEEN_NAXX);

        if (!@bool)
        {
            this.m_StartupAssetLoads++;
        }
        this.LoadSubScene(config.GetCurrentSubScene(), new AssetLoader.GameObjectCallback(this.OnFirstSubSceneLoaded));
        if (!@bool)
        {
            SoundManager.Get().Load("VO_KT_INTRO_39");
            AssetLoader.Get().LoadGameObject("KT_Quote", new AssetLoader.GameObjectCallback(this.OnKTQuoteLoaded), null, false);
        }
        Options.Get().SetBool(Option.BUNDLE_JUST_PURCHASE_IN_HUB, false);
        if (ApplicationMgr.IsInternal())
        {
            CheatMgr.Get().RegisterCheatHandler("advdev", new CheatMgr.ProcessCheatCallback(this.OnDevCheat), null, null, null);
        }
        this.InitializeAllDefs();
    }
Example #4
0
 protected override void Load()
 {
     if (yirdName == AdventureScene.MainAdventure.ToString())
     {
         LoadAdventure(newGame);
         curType = AdventureScene.MainAdventure;
     }
     else if (yirdName == AdventureScene.Dungen.ToString())
     {
         LoadYird(newGame, AdventureScene.Dungen);
         curType = AdventureScene.Dungen;
     }
 }