Beispiel #1
0
        private void InitLevel(int level)
        {
            switch (level)
            {
            case 1:
                Level1.InitIntro(animationService, introspeedincrease);
                canmorph = false;
                break;

            case 2:
                Level2.InitIntro(animationService, introspeedincrease);
                canmorph = false;
                break;

            case 3:     //challenge
                Level3.InitIntro(animationService, -2);
                break;

            case 4:
                Level4.InitIntro(animationService, introspeedincrease);
                maxwaittimebetweendives = 4000;
                canmorph = true;
                break;

            case 5:
                Level5.InitIntro(animationService, introspeedincrease);
                maxwaittimebetweendives = 3000;
                divespeedincrease       = 1;
                missileincrease         = 1;
                canmorph = true;
                break;

            case 6:
                Level6.InitIntro(animationService, introspeedincrease);
                maxwaittimebetweendives = 2500;
                divespeedincrease       = 1;
                missileincrease         = 1;
                introspeedincrease      = 1;
                canmorph = true;
                break;

            case 7:     //challenge
                Level8.InitIntro(animationService, -2);
                break;

            case 8:
                Level7.InitIntro(animationService, introspeedincrease);
                maxwaittimebetweendives = 2500;
                divespeedincrease       = 1;
                missileincrease         = 2;
                introspeedincrease      = 1;
                canmorph = true;
                break;

            case 9:
                Level9.InitIntro(animationService, introspeedincrease);
                maxwaittimebetweendives = 2000;
                divespeedincrease       = 2;
                missileincrease         = 2;
                introspeedincrease      = 1;
                canmorph = true;
                break;

            case 10:
                Level10.InitIntro(animationService, introspeedincrease);
                maxwaittimebetweendives = 1500;
                divespeedincrease       = 1;
                missileincrease         = 3;
                introspeedincrease      = 2;
                canmorph = false;
                break;

            case 11:     //challenge
                Level11.InitIntro(animationService, -3);
                break;
            }

            GetBugs().ForEach(a => {
                a.Paths.ForEach(p => {
                    if (p.IsIntroPath)
                    {
                        a.PathPoints.AddRange(animationService.ComputePathPoints(p, false, 20));
                    }
                    else
                    {
                        a.PathPoints.AddRange(animationService.ComputePathPoints(p, false));
                    }
                });
            });

            ////draw path logic for debugging only
            //var drawpathbug1 = GetBugs().FirstOrDefault(a => a.Intro is Challenge3);
            //var drawpathbug2 = GetBugs().FirstOrDefault(a => a.Intro is Challenge4);

            //drawpathbug1.DrawPath = true;
            //drawpathbug1.DrawControlLines = true;

            //drawpathbug2.DrawPath = true;
            //drawpathbug2.DrawControlLines = true;

            //drawpathbug2.Paths.ForEach(a =>
            //{
            //    a.OutPutDebug = true;
            //    a.DrawPath = true;
            //});
            ////end draw path debugging logic

            GetBugs().Where(a => a.Wave == 1).ToList().ForEach(a => a.Started = true);

            AIManager.aidodgeing = false;
        }