Ejemplo n.º 1
0
        private void InitializeChapter1Levels()
        {
            var chapter = Chapters[0];

            chapter.Levels = new List<LevelInfoPresentation>();

            var currentPosition = new Vector2(0, 50);

            int i = 0;

            foreach (var info in GetLevelInfoChapter1())
            {
                var level = new LevelInfoPresentation();
                level.Id = info.Id;
                level.LevelType = info.LevelType;
                level.Name = info.Name;
                level.Score = info.Score;
                level.Texture = gameContext.Content.Load<Texture2D>(info.TexturePath);
                level.Position = currentPosition;
                level.Bounds = new Rectangle((int)level.Position.X, (int)level.Position.Y, level.Texture.Width, level.Texture.Height);

                foreach (var challengeContent in info.Challenges)
                {
                    var challenge = new LevelChallengePresentation();
                    challenge.Id = challengeContent.Id;
                    challenge.Name = challengeContent.Name;
                    challenge.Description = challengeContent.Description;
                    challenge.IsCompleted = challengeContent.IsCompleted;
                    level.Challenges.Add(challenge);
                }

                chapter.Levels.Add(level);
                currentPosition += new Vector2(192 + 10, 0);

                i++;

                if (i == 3)
                {
                    chapter.Levels.Add(GetFirstMrMoonLevel(currentPosition));
                    currentPosition += new Vector2(192 + 10, 0);
                }
                else if (i == 6)
                {
                    chapter.Levels.Add(GetSecondMrMoonLevel(currentPosition));
                    currentPosition += new Vector2(192 + 10, 0);
                }
                else if (i == 9)
                {
                    chapter.Levels.Add(GetThirdMrMoonLevel(currentPosition));
                    currentPosition += new Vector2(192 + 10, 0);
                }
            }
        }
Ejemplo n.º 2
0
        private LevelInfoPresentation GetSecondMrMoonLevel(Vector2 currentPosition)
        {
            var stopLevel = new LevelInfoPresentation();
            stopLevel.LevelInfoMrMoon = new LevelInfoMrMoon();
            stopLevel.Name = string.Empty;
            stopLevel.Texture = mrMoonBackground;
            stopLevel.Position = currentPosition;
            stopLevel.LevelInfoMrMoon.RequiredStars = 20;
            stopLevel.Bounds = new Rectangle((int)stopLevel.Position.X, (int)stopLevel.Position.Y, stopLevel.Texture.Width, stopLevel.Texture.Height);

            var script = new MrMoonScript();
            script.Title.Add("Thieves! Everywhere!");
            script.Description.Add("I cant believe this happened to me again. When i woke up");
            script.Description.Add("this morning, they were all gone. Would you please");
            script.Description.Add(string.Format("help me bring {0} stars back here?", stopLevel.LevelInfoMrMoon.RequiredStars));
            stopLevel.LevelInfoMrMoon.Scripts.Add(script);

            script = new MrMoonScript();
            script.Title.Add("Fantastic!");
            script.Description.Add("You sure saved the day once again my friend.");
            script.Description.Add("Please proceed. If you find that thief, wont you");
            script.Description.Add("bring him to me?");
            stopLevel.LevelInfoMrMoon.Scripts.Add(script);

            return stopLevel;
        }
Ejemplo n.º 3
0
        private LevelInfoPresentation GetThirdMrMoonLevel(Vector2 currentPosition)
        {
            var stopLevel = new LevelInfoPresentation();
            stopLevel.Name = string.Empty;
            stopLevel.Texture = mrMoonBackground;
            stopLevel.Position = currentPosition;
            stopLevel.Bounds = new Rectangle((int)stopLevel.Position.X, (int)stopLevel.Position.Y, stopLevel.Texture.Width, stopLevel.Texture.Height);
            stopLevel.LevelInfoMrMoon = new LevelInfoMrMoon();
            stopLevel.LevelInfoMrMoon.IsEvil = true;
            stopLevel.LevelInfoMrMoon.RequiredStars = 32;

            var script = new MrMoonScript();
            script.Title.Add("Been looking for me?");
            script.Description.Add("I wont give up my precious stars that easily.");
            script.Description.Add("Im always up for a challenge though, so ill tell you what.");
            script.Description.Add(string.Format("If you can collect {0} stars i will leave your friend alone.", stopLevel.LevelInfoMrMoon.RequiredStars));
            stopLevel.LevelInfoMrMoon.Scripts.Add(script);

            script = new MrMoonScript();
            script.Title.Add("Grrr!");
            script.Description.Add("I cant believe i lost! How did you manage to collect all");
            script.Description.Add("those stars!? Im a moon of my words so ive sent all stars");
            script.Description.Add("back to where they belong.");
            stopLevel.LevelInfoMrMoon.Scripts.Add(script);

            return stopLevel;
        }
Ejemplo n.º 4
0
        private LevelInfoPresentation GetFirstMrMoonLevel(Vector2 currentPosition)
        {
            var stopLevel = new LevelInfoPresentation();
            stopLevel.LevelInfoMrMoon = new LevelInfoMrMoon();
            stopLevel.Name = string.Empty;
            stopLevel.Texture = mrMoonBackground;
            stopLevel.Position = currentPosition;
            stopLevel.LevelInfoMrMoon.RequiredStars = 12;
            stopLevel.Bounds = new Rectangle((int)stopLevel.Position.X, (int)stopLevel.Position.Y, stopLevel.Texture.Width, stopLevel.Texture.Height);

            var script = new MrMoonScript();
            script.Title.Add("Hey! You there!");
            script.Title.Add("Someone has stolen all my stars!");
            script.Description.Add("I cant let you pass that easily knowing you might be");
            script.Description.Add(string.Format("a thief. Bring me back {0} stars and i just might let", stopLevel.LevelInfoMrMoon.RequiredStars));
            script.Description.Add("you off... with a warning.");
            stopLevel.LevelInfoMrMoon.Scripts.Add(script);

            script = new MrMoonScript();
            script.Title.Add("Amazing! Splendid work my friend.");
            script.Description.Add("I didnt think you would make it, least not this quick.");
            script.Description.Add("Please proceed. I guess you didnt steal my stars after all.");
            stopLevel.LevelInfoMrMoon.Scripts.Add(script);

            return stopLevel;
        }