示例#1
0
    private Level7 l7;                          // reference to the Level 7 component
    // Use this for initialization
    void Start()
    {
        anim = GetComponent <Animator>();

        if (SceneManager.GetActiveScene().name == "Level-7")
        {
            l7 = GameObject.Find("DespensableScripts").GetComponent <Level7> ();
        }
    }
示例#2
0
        static void Main(string[] args)
        {
            Greetings.UserName();

            Level1.NumberGuessRange();

            Level2.NumberGuessRange();

            Level3.NumberGuessRange();

            Level4.NumberGuessRange();

            Level5.NumberGuessRange();

            Level6.NumberGuessRange();

            Level7.NumberGuessRange();

            Level8.NumberGuessRange();

            Level9.NumberGuessRange();

            Level10.NumberGuessRange();
        }
        public void ChangeLevel(int id)
        {
            levelid = id;
            soundStopped = false;
            gdReset = true;
            switch (levelid)
            {
                case 0:
                    {
                        level0 = new Level0(graphicDevice, "level0.gleed");
                        level1 = null;
                        level2 = null;
                        level3 = null;
                        level4 = null;
                        level5 = null;
                        level6 = null;
                        level7 = null;
                    }
                    break;
                case 1:
                    {
                        level0 = null;
                        level1 = new Level1(graphicDevice, "level1.gleed");
                        level2 = null;
                        level3 = null;
                        level4 = null;
                        level5 = null;
                        level6 = null;
                        level7 = null;
                    }
                    break;
                case 2:
                    {
                        level0 = null;
                        level1 = null;
                        level2 = new Level2(graphicDevice, "level2.gleed");
                        level3 = null;
                        level4 = null;
                        level5 = null;
                        level6 = null;
                        level7 = null;

                    }
                    break;
                case 3:
                    {
                        level0 = null;
                        level1 = null;
                        level2 = null;
                        level3 = new Level3(graphicDevice, "level3.gleed");
                        level4 = null;
                        level5 = null;
                        level6 = null;
                        level7 = null;

                    }
                    break;
                case 4:
                    {
                        level0 = null;
                        level1 = null;
                        level2 = null;
                        level3 = null;
                        level4 = new Level4(graphicDevice, "level4.gleed");
                        level5 = null;
                        level6 = null;
                        level7 = null;

                    }
                    break;
                case 5:
                    {
                        level0 = null;
                        level1 = null;
                        level2 = null;
                        level3 = null;
                        level4 = null;
                        level5 = new Level5(graphicDevice, "level5.gleed");
                        level6 = null;
                        level7 = null;

                    }
                    break;
                case 6:
                    {
                        level0 = null;
                        level1 = null;
                        level2 = null;
                        level3 = null;
                        level4 = null;
                        level5 = null;
                        level6 = new Level6(graphicDevice, "level6.gleed");
                        level7 = null;

                    }
                    break;
                case 7:
                    {
                        level0 = null;
                        level1 = null;
                        level2 = null;
                        level3 = null;
                        level4 = null;
                        level5 = null;
                        level6 = null;
                        level7 = new Level7(graphicDevice, "Level7.gleed");

                    }
                    break;

                default: break;
            }
        }
示例#4
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;
        }
示例#5
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            LEVEL_WIDTH  = GraphicsDevice.DisplayMode.Width / 2;
            LEVEL_HEIGHT = GraphicsDevice.DisplayMode.Height / 2;
            graphics.PreferredBackBufferWidth  = LEVEL_WIDTH;
            graphics.PreferredBackBufferHeight = LEVEL_HEIGHT;
            graphics.ApplyChanges();
            this.rodStewart    = Content.Load <Song>("song");
            this.sunshine      = Content.Load <Song>("Sunshine");
            MediaPlayer.Volume = 0.1f;
            MediaPlayer.Play(rodStewart);
            MediaPlayer.IsRepeating = false;
            textStillToType         = true;

            this.level3Sound    = Content.Load <SoundEffect>("lolSoundEffect");
            level3Inst          = this.level3Sound.CreateInstance();
            level3Inst.IsLooped = false;

            this.level7Bus      = Content.Load <SoundEffect>("BusSound");
            level7Inst          = this.level7Bus.CreateInstance();
            level7Inst.IsLooped = true;

            this.typingSound    = Content.Load <SoundEffect>("Keyboard");
            typingInst          = this.typingSound.CreateInstance();
            typingInst.IsLooped = true;

            SoundEffect.MasterVolume = 0.15f;

            // TODO: Add your initialization logic here
            levelNumber = 9;


            levelOne              = new Level1();
            levelOne.LEVEL_WIDTH  = LEVEL_WIDTH;
            levelOne.LEVEL_HEIGHT = LEVEL_HEIGHT;
            levelOne.Initialize();


            levelTwo              = new Level2();
            levelTwo.LEVEL_WIDTH  = LEVEL_WIDTH;
            levelTwo.LEVEL_HEIGHT = LEVEL_HEIGHT;
            levelTwo.Initialize();

            levelThree              = new Level3();
            levelThree.convoNumber  = 1;
            levelThree.LEVEL_WIDTH  = LEVEL_WIDTH;
            levelThree.LEVEL_HEIGHT = LEVEL_HEIGHT;
            levelThree.Initialize();


            levelFour              = new Level4();
            levelFour.LEVEL_WIDTH  = LEVEL_WIDTH;
            levelFour.LEVEL_HEIGHT = LEVEL_HEIGHT;
            levelFour.Initialize();

            levelFive              = new Level5();
            levelFive.LEVEL_WIDTH  = LEVEL_WIDTH;
            levelFive.LEVEL_HEIGHT = LEVEL_HEIGHT;
            levelFive.Initialize();

            levelSix              = new Level6();
            levelSix.LEVEL_WIDTH  = LEVEL_WIDTH;
            levelSix.LEVEL_HEIGHT = LEVEL_HEIGHT;
            levelSix.Initialize();

            levelSeven              = new Level7();
            levelSeven.LEVEL_WIDTH  = LEVEL_WIDTH;
            levelSeven.LEVEL_HEIGHT = LEVEL_HEIGHT;
            levelSeven.Initialize();

            levelEight              = new Level8();
            levelEight.LEVEL_WIDTH  = LEVEL_WIDTH;
            levelEight.LEVEL_HEIGHT = LEVEL_HEIGHT;
            levelEight.Initialize();

            levelNine              = new Level9();
            levelNine.LEVEL_WIDTH  = LEVEL_WIDTH;
            levelNine.LEVEL_HEIGHT = LEVEL_HEIGHT;
            levelNine.Initialize();

            levelTen              = new Level10();
            levelTen.LEVEL_WIDTH  = LEVEL_WIDTH;
            levelTen.LEVEL_HEIGHT = LEVEL_HEIGHT;
            levelTen.Initialize();

            levelEle              = new Level11();
            levelEle.LEVEL_WIDTH  = LEVEL_WIDTH;
            levelEle.LEVEL_HEIGHT = LEVEL_HEIGHT;
            levelEle.Initialize();


            levelTwe              = new Level12();
            levelTwe.LEVEL_WIDTH  = LEVEL_WIDTH;
            levelTwe.LEVEL_HEIGHT = LEVEL_HEIGHT;
            levelTwe.Initialize();

            levelTteen              = new Level13();
            levelTteen.LEVEL_WIDTH  = LEVEL_WIDTH;
            levelTteen.LEVEL_HEIGHT = LEVEL_HEIGHT;
            levelTteen.Initialize();

            levelFourteen              = new Level14();
            levelFourteen.LEVEL_WIDTH  = LEVEL_WIDTH;
            levelFourteen.LEVEL_HEIGHT = LEVEL_HEIGHT;
            levelFourteen.Initialize();

            levelFifteen              = new Level15();
            levelFifteen.LEVEL_WIDTH  = LEVEL_WIDTH;
            levelFifteen.LEVEL_HEIGHT = LEVEL_HEIGHT;
            levelFifteen.Initialize();

            levelSixteen              = new Level16();
            levelSixteen.LEVEL_WIDTH  = LEVEL_WIDTH;
            levelSixteen.LEVEL_HEIGHT = LEVEL_HEIGHT;
            levelSixteen.Initialize();

            levelSeventeen              = new Level17();
            levelSeventeen.LEVEL_WIDTH  = LEVEL_WIDTH;
            levelSeventeen.LEVEL_HEIGHT = LEVEL_HEIGHT;
            levelSeventeen.Initialize();



            transition        = false;
            levelProgressBBox = new Rectangle(LEVEL_WIDTH - 140, 0, 140, LEVEL_HEIGHT);
            transitionPos     = new Vector2(0, 0);

            base.Initialize();
        }
示例#6
0
    // Use this for initialization
    void Start()
    {
        audioplay = GameObject.FindGameObjectWithTag("SoundLoader").GetComponent <AudioScript>();

        var scaleFactor = ScaleFactor.GetScaleFactor();

        var backButton = UIButton.create(buttonsManager2, "CloseBtn.png", "CloseBtn.png", 0, 0);

        backButton.onTouchUpInside += sender => Application.LoadLevel("AGAIN");
        backButton.positionFromCenter(-0.42f, 0.355f);
        backButton.setSize(backButton.width / scaleFactor * 1f, backButton.height / scaleFactor * 1f);


        Level1 = UIButton.create(buttonsManager, "L1.png", "L1.png", 0, 0);
        Level1.setSize(Level1.width / scaleFactor, Level1.height / scaleFactor);
        Level1.onTouchUpInside += sender => Application.LoadLevel("Level1");
        Level2 = UIButton.create(buttonsManager, "L2.png", "L2.png", 0, 0);
        Level2.setSize(Level2.width / scaleFactor, Level2.height / scaleFactor);
        Level2.onTouchUpInside += sender => Application.LoadLevel("Level2");
        Level2.onTouchUpInside += sender => Basket.levelShortcutSet(0);
        Level3 = UIButton.create(buttonsManager, "L3.png", "L3.png", 0, 0);
        Level3.setSize(Level3.width / scaleFactor, Level3.height / scaleFactor);
        Level3.onTouchUpInside += sender => Application.LoadLevel("Level3");
        Level3.onTouchUpInside += sender => Basket.levelShortcutSet(0);
        Level4 = UIButton.create(buttonsManager, "L4.png", "L4.png", 0, 0);
        Level4.setSize(Level4.width / scaleFactor, Level4.height / scaleFactor);
        Level4.onTouchUpInside += sender => Application.LoadLevel("Level4");
        Level4.onTouchUpInside += sender => Basket.levelShortcutSet(0);
        Level5 = UIButton.create(buttonsManager, "L5.png", "L5.png", 0, 0);
        Level5.setSize(Level5.width / scaleFactor, Level5.height / scaleFactor);
        Level5.onTouchUpInside += sender => Application.LoadLevel("Level5");
        Level5.onTouchUpInside += sender => Basket.levelShortcutSet(0);
        Level6 = UIButton.create(buttonsManager, "L6.png", "L6.png", 0, 0);
        Level6.setSize(Level6.width / scaleFactor, Level6.height / scaleFactor);
        Level6.onTouchUpInside += sender => Application.LoadLevel("Level6");
        Level6.onTouchUpInside += sender => Basket.levelShortcutSet(0);
        Level7 = UIButton.create(buttonsManager, "L7.png", "L7.png", 0, 0);
        Level7.setSize(Level7.width / scaleFactor, Level7.height / scaleFactor);
        Level7.onTouchUpInside += sender => Application.LoadLevel("Level7");
        Level7.onTouchUpInside += sender => Basket.levelShortcutSet(0);
        Level8 = UIButton.create(buttonsManager, "L8.png", "L8.png", 0, 0);
        Level8.setSize(Level8.width / scaleFactor, Level8.height / scaleFactor);
        Level8.onTouchUpInside += sender => Application.LoadLevel("Level8");
        Level8.onTouchUpInside += sender => Basket.levelShortcutSet(0);
        Level9 = UIButton.create(buttonsManager, "L9.png", "L9.png", 0, 0);
        Level9.setSize(Level9.width / scaleFactor, Level9.height / scaleFactor);
        Level9.onTouchUpInside += sender => Application.LoadLevel("Level9");
        Level9.onTouchUpInside += sender => Basket.levelShortcutSet(0);
        Level10 = UIButton.create(buttonsManager, "L10.png", "L10.png", 0, 0);
        Level10.setSize(Level10.width / scaleFactor, Level10.height / scaleFactor);
        Level10.onTouchUpInside += sender => Application.LoadLevel("Level10");
        Level10.onTouchUpInside += sender => Basket.levelShortcutSet(0);

        Level1.positionFromCenter(-0.4f, 0f);
        Level2.parentUIObject = Level1;
        Level2.positionFromCenter(1.1f, 0f);
        Level3.parentUIObject = Level2;
        Level3.positionFromCenter(1.1f, 0f);
        Level4.parentUIObject = Level3;
        Level4.positionFromCenter(1.1f, 0f);
        Level5.parentUIObject = Level4;
        Level5.positionFromCenter(1.1f, 0f);
        Level6.parentUIObject = Level5;
        Level6.positionFromCenter(1.1f, 0f);
        Level7.parentUIObject = Level6;
        Level7.positionFromCenter(1.1f, 0f);
        Level8.parentUIObject = Level7;
        Level8.positionFromCenter(1.1f, 0f);
        Level9.parentUIObject = Level8;
        Level9.positionFromCenter(1.1f, 0f);
        Level10.parentUIObject = Level9;
        Level10.positionFromCenter(1.1f, 0f);

        Level1.touchDownSound     = audioplay.getSoundClip();
        Level2.touchDownSound     = audioplay.getSoundClip();
        Level3.touchDownSound     = audioplay.getSoundClip();
        Level4.touchDownSound     = audioplay.getSoundClip();
        Level5.touchDownSound     = audioplay.getSoundClip();
        Level6.touchDownSound     = audioplay.getSoundClip();
        Level7.touchDownSound     = audioplay.getSoundClip();
        Level8.touchDownSound     = audioplay.getSoundClip();
        Level9.touchDownSound     = audioplay.getSoundClip();
        Level10.touchDownSound    = audioplay.getSoundClip();
        backButton.touchDownSound = audioplay.getSoundClip();
    }