예제 #1
0
        public override void ProcessEvent(Event ev)
        {
            base.ProcessEvent(ev);

            if (ev is ScreenCancelEvent)
            {
                if ((ev as ScreenCancelEvent).Screen is LevelSelectScreen)
                {
                    Cam.targetScale = 2.0f;
                    Cam.LevelSelect = false;
                    EventManager.Get.SendEvent(new ScreenFadeInEvent(this));
                }
                else if ((ev as ScreenCancelEvent).Screen is WorldSelectScreen)
                {
                    EventManager.Get.SendEvent(new ScreenFadeOutEvent(this));
                }
            }
            else if (ev is MenuEvent)
            {
                MenuEvent e = ev as MenuEvent;
                if (e.sender is ArrowScroll)
                {
                    ArrowScroll s = e.sender as ArrowScroll;

                    if (s.Right)
                    {
                        NextLocation();
                    }
                    else
                    {
                        PrevLocation();
                    }

                    EventManager.Get.SendImmediateEvent(new NewLocationSelected());

                    string location = worldLocations[curLocation];

                    Cam.TargetPos   = map.GetLocation(location);
                    Cam.targetScale = 2;
                    Cam.LevelSelect = false;

                    /*
                     * currentLocation = new LocationIcon(location, map);
                     * currentLocation.Initialize(Content);
                     * scene.AddNode(currentLocation);*/

                    AudioManager.PlayOnce("Sounds/ChangeCountry");
                }
            }

            /*
             * if (ev is ScreenAddedEvent)
             * {
             *  if ((ev as ScreenAddedEvent).Screen is GameplayScreen)
             *  {
             *      RaiseFlag(Flags.DELETE);
             *  }
             * }*/

            /*if (ev is ScreenFadeInCompleteEvent)
             * {
             *  if ((ev as ScreenFadeInCompleteEvent).Screen is GameplayScreen)
             *  {
             *      RaiseFlag(Flags.DELETE);
             *  }
             * }*/

            if (ev is FadeOutEvent)
            {
                if ((ev as FadeOutEvent).Sender is FallingFeathers)
                {
                    RaiseFlag(Flags.DELETE);
                }
            }
        }
예제 #2
0
        public override void Initialize(Microsoft.Xna.Framework.Content.ContentManager content)
        {
            base.Initialize(content);
            FarWorld world = new FarWorld();

            scene = new GameScene(world, Content);

            locationText.Initialize(Content);
            locationText.Text = "NONE";

            ArrowScroll a = new ArrowScroll();

            a.Initialize(Content);
            a.Right = false;
            scene.AddNode(a);


            a = new ArrowScroll();
            a.Initialize(Content);
            scene.AddNode(a);


            map = new MapUI();
            map.Initialize(Content);

            scene.AddNode(map);


            Components.Add(scene);


            for (int i = 0; i < ChicksnVixensGame.Get.locationOrder.Count; i++)
            {
                worldLocations.Add(ChicksnVixensGame.Get.locationOrder[i]);
            }

            BlankNess faderInner = new BlankNess();

            faderInner.Initialize(Content);

            faderInner.fullBlankity = 1.0f;
            faderInner.fadeInTimer  = 1.0f;
            faderInner.fadeSpeed    = 2.0f;
            faderInner.RaiseFlag(Flags.FADE_OUT);
            Components.Add(faderInner);


            locked = new MenuObj("ui/ui");
            locked.Initialize(content);
            locked.CreateFramesFromXML("ui/ui_frames");
            locked.CurrentFrame = "lock";
            locked.ResetDimensions();
            locked.UniformScale = ScaleFactor * 2.0f;
            locked.Position     = Vector2.Zero;
            locked.Colour       = new Color(0, 0, 0, 0);
            Components.Add(locked);

            EventManager.Get.SendImmediateEvent(new NewLocationSelected());

            string location = worldLocations[curLocation];

            Cam.TargetPos   = map.GetLocation(location);
            Cam.targetScale = 2;
            Cam.LevelSelect = false;
        }
예제 #3
0
        public override void Initialize(Microsoft.Xna.Framework.Content.ContentManager content)
        {
            base.Initialize(content);
            FarWorld world = new FarWorld();
            scene = new GameScene(world, Content);

            locationText.Initialize(Content);
            locationText.Text = "NONE";

            ArrowScroll a = new ArrowScroll();
            a.Initialize(Content);
            a.Right = false;
            scene.AddNode(a);

            a = new ArrowScroll();
            a.Initialize(Content);
            scene.AddNode(a);

            map = new MapUI();
            map.Initialize(Content);

            scene.AddNode(map);

            Components.Add(scene);

            for (int i = 0; i < ChicksnVixensGame.Get.locationOrder.Count; i++)
            {
                worldLocations.Add(ChicksnVixensGame.Get.locationOrder[i]);
            }

            BlankNess faderInner = new BlankNess();
            faderInner.Initialize(Content);

            faderInner.fullBlankity = 1.0f;
            faderInner.fadeInTimer = 1.0f;
            faderInner.fadeSpeed = 2.0f;
            faderInner.RaiseFlag(Flags.FADE_OUT);
            Components.Add(faderInner);

            locked = new MenuObj("ui/ui");
            locked.Initialize(content);
            locked.CreateFramesFromXML("ui/ui_frames");
            locked.CurrentFrame = "lock";
            locked.ResetDimensions();
            locked.UniformScale = ScaleFactor * 2.0f;
            locked.Position = Vector2.Zero;
            locked.Colour = new Color(0, 0, 0, 0);
            Components.Add(locked);

            EventManager.Get.SendImmediateEvent(new NewLocationSelected());

            string location = worldLocations[curLocation];

            Cam.TargetPos = map.GetLocation(location);
            Cam.targetScale = 2;
            Cam.LevelSelect = false;
        }