Example #1
0
        public override void Initialize(ContentManager content)
        {
            base.Initialize(content);
            screenCamera = new LevelSelectCam();
            scene        = new Jabber.Scene.GameScene(new FarWorld(), Content);
            scene.Initialize(Content);

            BackButton b = new BackButton();

            b.Initialize(Content);
            scene.AddNode(b);

            Button movie = new Button("ui/ui");

            movie.Initialize(Content);
            movie.CreateFramesFromXML("ui/ui_frames");
            movie.CurrentFrame = "movie";
            movie.ResetDimensions();
            movie.RegularScale = ScaleFactor * 0.48f;
            movie.ScaleOnHover = movie.RegularScale * 1.1f;
            movie.UniformScale = ScaleFactor * 0.48f;
            movie.PosX         = -0.37f * BaseGame.Get.BackBufferWidth;
            movie.PosY         = -0.42f * BaseGame.Get.BackBufferHeight;
            scene.AddNode(movie);

            int numLevels = 0;

            switch (location)
            {
            case "uluru":
                numLevels = NumLevelsUluru;
                break;

            case "polar":
                numLevels = NumLevelsPolar;
                break;

            case "bavaria":
                numLevels = NumLevelsBavaria;
                break;

            case "paris":
                numLevels = NumLevelsParis;
                break;

            case "vesuvius":
                numLevels = NumLevelsVesuvius;
                break;
            }

            (screenCamera as LevelSelectCam).NumLevels = numLevels;

            /*
             #if WINDOWS_PHONE
             * using (IsolatedStorageFile isolatedStorageFile = IsolatedStorageFile.GetUserStoreForApplication())
             * {
             *  while (true)
             *  {
             *
             *      string dir = "Content/Levels/" + location + "/Level" + (numLevels + 1) + ".xml";
             *      try
             *      {
             *          //  "Content/Levels/paris/Level2.xml";
             *
             *          XDocument.Load(dir);
             ++numLevels;
             *      }
             *      catch (Exception e)
             *      {
             *          break;
             *      }
             *  }
             * }
             #else
             * while (true)
             * {
             *  if (File.Exists("Content/Levels/" + location + "/Level" + (numLevels + 1) + ".xml"))
             ++numLevels;
             *  else
             *      break;
             * }
             #endif
             */
            while (numLevels > 0)
            {
                int currentColumn = 0;
                while (true)
                {
                    for (int j = 0; j < 4; j++)
                    {
                        if (numLevels == 0)
                        {
                            break;
                        }
                        for (int i = 0; i < 5; i++)
                        {
                            LevelButton but = new LevelButton(i, j, currentColumn, location);
                            but.Initialize(Content);
                            scene.AddNode(but);
                            levelButtons.Add(but);
                            --numLevels;
                            if (numLevels == 0)
                            {
                                break;
                            }
                        }
                    }
                    if (numLevels == 0)
                    {
                        break;
                    }
                    ++currentColumn;
                }
            }

            blank = new BlankNess();
            blank.fullBlankity = 0.75f;
            blank.Initialize(Content);
            scene.AddNode(blank);
            blank.RaiseFlag(Flags.FADE_IN);

            Components.Add(scene);
        }
Example #2
0
        public override void Initialize(ContentManager content)
        {
            base.Initialize(content);
            screenCamera = new LevelSelectCam();
            scene = new Jabber.Scene.GameScene(new FarWorld(), Content);
            scene.Initialize(Content);

            BackButton b = new BackButton();
            b.Initialize(Content);
            scene.AddNode(b);

            Button movie = new Button("ui/ui");
            movie.Initialize(Content);
            movie.CreateFramesFromXML("ui/ui_frames");
            movie.CurrentFrame = "movie";
            movie.ResetDimensions();
            movie.RegularScale = ScaleFactor * 0.48f;
            movie.ScaleOnHover = movie.RegularScale * 1.1f;
            movie.UniformScale = ScaleFactor * 0.48f;
            movie.PosX = -0.37f * BaseGame.Get.BackBufferWidth;
            movie.PosY = -0.42f * BaseGame.Get.BackBufferHeight;
            scene.AddNode(movie);

            int numLevels = 0;
            switch (location)
            {
                case "uluru":
                    numLevels = NumLevelsUluru;
                    break;
                case "polar":
                    numLevels = NumLevelsPolar;
                    break;
                case "bavaria":
                    numLevels = NumLevelsBavaria;
                    break;
                case "paris":
                    numLevels = NumLevelsParis;
                    break;
                case "vesuvius":
                    numLevels = NumLevelsVesuvius;
                    break;
            }

            (screenCamera as LevelSelectCam).NumLevels = numLevels;
            /*
            #if WINDOWS_PHONE
            using (IsolatedStorageFile isolatedStorageFile = IsolatedStorageFile.GetUserStoreForApplication())
            {
                while (true)
                {

                    string dir = "Content/Levels/" + location + "/Level" + (numLevels + 1) + ".xml";
                    try
                    {
                        //  "Content/Levels/paris/Level2.xml";

                        XDocument.Load(dir);
                        ++numLevels;
                    }
                    catch (Exception e)
                    {
                        break;
                    }
                }
            }
            #else
            while (true)
            {
                if (File.Exists("Content/Levels/" + location + "/Level" + (numLevels + 1) + ".xml"))
                    ++numLevels;
                else
                    break;
            }
            #endif
            */
            while (numLevels > 0)
            {
                int currentColumn = 0;
                while (true)
                {
                    for (int j = 0; j < 4; j++)
                    {
                        if (numLevels == 0)
                        {
                            break;
                        }
                        for (int i = 0; i < 5; i++)
                        {
                            LevelButton but = new LevelButton(i, j, currentColumn, location);
                            but.Initialize(Content);
                            scene.AddNode(but);
                            levelButtons.Add(but);
                            --numLevels;
                            if (numLevels == 0)
                            {
                                break;
                            }
                        }
                    }
                    if(numLevels == 0)
                    {
                        break;
                    }
                    ++currentColumn;
                }

            }

            blank = new BlankNess();
            blank.fullBlankity = 0.75f;
            blank.Initialize(Content);
            scene.AddNode(blank);
            blank.RaiseFlag(Flags.FADE_IN);

            Components.Add(scene);
        }