private bool isActualChoice(LevelChoice c)
        {
            HeroBuild build = HoNBP.ActualBuild();

            if (build.getChoiceType(build.Level()) == c) return true;
            else return false;
        }
Beispiel #2
0
 private void Awake()
 {
     if (_instance != null)
     {
         Destroy(gameObject);
     }
     else
     {
         _instance = this;
     }
 }
        private void buildLevelUp(LevelChoice c)
        {
            HeroBuild build = HoNBP.ActualBuild();

            build.Choice(build.Level(), c);
            if (build.Level() == build.MaxLevel())
            {
                build.LevelUp();
                changeBuildLevel(build.Level() + 1);
            }
            else
            {
                updateAllHero();
            }
        }
Beispiel #4
0
    private void Start()
    {
        GameObject canvas = GameObject.Find("Canvas");

        profile             = canvas.GetComponentInChildren <ProfileBehaviour>();
        settings            = canvas.GetComponentInChildren <SettingsBehaviour>();
        level_choice        = canvas.GetComponentInChildren <LevelChoice>();
        key_binding_options = canvas.GetComponentInChildren <KeyBindingOptions>();

        settings.Start_();

        profile.Shown             = false;
        settings.Shown            = false;
        level_choice.Shown        = false;
        key_binding_options.Shown = false;
    }
        public void PlayVideoStateDeserialization(StreamingContext context)
        {
            gamepadstate = new GamePadState();
            playTheMusic = PlayTheMusic.Yes;
            // TODO: Add your initialization logic here
            videotexturerect        = new Rectangle(0, 120, 512, 256);
            this.state              = 0;
            backgroundRect          = new Rectangle(0, 0, 800, 600);
            backgroundPath          = "PlayVideoState/backgroundcode";
            videoPath               = "PlayVideoState/deepestmasterofcode";
            video2Path              = "PlayVideoState/computerrepairspeedvideofinal";
            videogamemusicPath      = "PlayVideoState/bgmusic01";
            fontPath                = "ResumeGamePlayState/SpriteFont1";
            continueButtonImgPath   = "LeapTimeButton/continue";
            soundContinueButtonPath = "ResumeGamePlayState/boom";
            levelChoice             = LevelChoice.LevelOne;

            displayLoading = false;
        }
Beispiel #6
0
        /// <summary>Sets game level</summary>
        private static void Level(LevelChoice whatToDo, Snake[] sammy)
        {
            switch (whatToDo)
            {
                case LevelChoice.StartOver:
                    CurLevel = 1;
                    break;

                case LevelChoice.NextLevel:
                    CurLevel = CurLevel + 1;
                    break;
            }

            // Initialize Snakes
            sammy[0].Head = 1;
            sammy[0].Length = 2;
            sammy[0].Alive = true;
            sammy[1].Head = 1;
            sammy[1].Length = 2;
            sammy[1].Alive = true;
            Inputs[0].Clear();
            Inputs[1].Clear();

            InitColors();

            switch (CurLevel)
            {
                case 1:
                    sammy[0].Row = 25;
                    sammy[1].Row = 25;
                    sammy[0].Col = 50;
                    sammy[1].Col = 30;
                    sammy[0].Direction = Direction.Right;
                    sammy[1].Direction = Direction.Left;
                    break;

                case 2:
                    for (int i = 20; i <= 60; i++)
                        Set(25, i, Walls);
                    sammy[0].Row = 7;
                    sammy[1].Row = 43;
                    sammy[0].Col = 60;
                    sammy[1].Col = 20;
                    sammy[0].Direction = Direction.Left;
                    sammy[1].Direction = Direction.Right;
                    break;

                case 3:
                    for (int i = 10; i <= 40; i++)
                    {
                        Set(i, 20, Walls);
                        Set(i, 60, Walls);
                    }
                    sammy[0].Row = 25;
                    sammy[1].Row = 25;
                    sammy[0].Col = 50;
                    sammy[1].Col = 30;
                    sammy[0].Direction = Direction.Up;
                    sammy[1].Direction = Direction.Down;
                    break;

                case 4:
                    for (int i = 4; i <= 30; i++)
                    {
                        Set(i, 20, Walls);
                        Set(53 - i, 60, Walls);
                    }
                    for (int i = 2; i <= 40; i++)
                    {
                        Set(38, i, Walls);
                        Set(15, 81 - i, Walls);
                    }
                    sammy[0].Row = 7;
                    sammy[1].Row = 43;
                    sammy[0].Col = 60;
                    sammy[1].Col = 20;
                    sammy[0].Direction = Direction.Left;
                    sammy[1].Direction = Direction.Right;
                    break;

                case 5:
                    for (int i = 13; i <= 39; i++)
                    {
                        Set(i, 21, Walls);
                        Set(i, 59, Walls);
                    }
                    for (int i = 23; i <= 57; i++)
                    {
                        Set(11, i, Walls);
                        Set(41, i, Walls);
                    }
                    sammy[0].Row = 25;
                    sammy[1].Row = 25;
                    sammy[0].Col = 50;
                    sammy[1].Col = 30;
                    sammy[0].Direction = Direction.Up;
                    sammy[1].Direction = Direction.Down;
                    break;

                case 6:
                    for (int i = 4; i <= 49; i++)
                    {
                        if (i > 30 || i < 23)
                        {
                            Set(i, 10, Walls);
                            Set(i, 20, Walls);
                            Set(i, 30, Walls);
                            Set(i, 40, Walls);
                            Set(i, 50, Walls);
                            Set(i, 60, Walls);
                            Set(i, 70, Walls);
                        }
                    }
                    sammy[0].Row = 7;
                    sammy[1].Row = 43;
                    sammy[0].Col = 65;
                    sammy[1].Col = 15;
                    sammy[0].Direction = Direction.Down;
                    sammy[1].Direction = Direction.Up;
                    break;

                case 7:
                    for (int i = 4; i <= 49; i += 2)
                        Set(i, 40, Walls);
                    sammy[0].Row = 7;
                    sammy[1].Row = 43;
                    sammy[0].Col = 65;
                    sammy[1].Col = 15;
                    sammy[0].Direction = Direction.Down;
                    sammy[1].Direction = Direction.Up;
                    break;

                case 8:
                    for (int i = 4; i <= 40; i++)
                    {
                        Set(i, 10, Walls);
                        Set(53 - i, 20, Walls);
                        Set(i, 30, Walls);
                        Set(53 - i, 40, Walls);
                        Set(i, 50, Walls);
                        Set(53 - i, 60, Walls);
                        Set(i, 70, Walls);
                    }
                    sammy[0].Row = 7;
                    sammy[1].Row = 43;
                    sammy[0].Col = 65;
                    sammy[1].Col = 15;
                    sammy[0].Direction = Direction.Down;
                    sammy[1].Direction = Direction.Up;
                    break;

                case 9:
                    for (int i = 6; i <= 47; i++)
                    {
                        Set(i, i, Walls);
                        Set(i, i + 28, Walls);
                    }
                    sammy[0].Row = 40;
                    sammy[1].Row = 15;
                    sammy[0].Col = 75;
                    sammy[1].Col = 5;
                    sammy[0].Direction = Direction.Up;
                    sammy[1].Direction = Direction.Down;
                    break;

                default:
                    for (int i = 4; i <= 49; i += 2)
                    {
                        Set(i, 10, Walls);
                        Set(i + 1, 20, Walls);
                        Set(i, 30, Walls);
                        Set(i + 1, 40, Walls);
                        Set(i, 50, Walls);
                        Set(i + 1, 60, Walls);
                        Set(i, 70, Walls);
                    }
                    sammy[0].Row = 7;
                    sammy[1].Row = 43;
                    sammy[0].Col = 65;
                    sammy[1].Col = 15;
                    sammy[0].Direction = Direction.Down;
                    sammy[1].Direction = Direction.Up;
                    break;
            }
        }
Beispiel #7
0
        public bool CanChooseSkill(LevelChoice c)
        {
            int count = 0;
            for (int i = 0; i < m_maxLevel; i++)
            {
                if (m_Choices[i] == c) count++;
            }

            if (c == LevelChoice.AttributeBooster && count < 10) return true;
            else if (c == LevelChoice.AttributeBooster && count >= 10) return false;

            if ((c == LevelChoice.Skill1 || c == LevelChoice.Skill2 || c == LevelChoice.Skill3) &&
               (count == 0 || (count == 1 && m_curLevel >= 3) || (count == 2 && m_curLevel >= 5) || (count == 3 && m_curLevel >= 7)))
                return true;
            else if (c == LevelChoice.SkillUltimate &&
                ((count == 0 && m_curLevel >= 6) || (count == 1 && m_curLevel >= 11) || (count == 2 && m_curLevel >= 16)))
                return true;

            return false;
        }
Beispiel #8
0
 public void Choice(int level, LevelChoice c)
 {
     if (level < 1 || level > 25 || !CanChooseSkill(c)) return;
     m_Choices[level - 1] = c;
 }
Beispiel #9
0
        /// <summary>Sets game level</summary>
        private static void Level(LevelChoice whatToDo, Snake[] sammy)
        {
            switch (whatToDo)
            {
            case LevelChoice.StartOver:
                CurLevel = 1;
                break;

            case LevelChoice.NextLevel:
                CurLevel = CurLevel + 1;
                break;
            }

            // Initialize Snakes
            sammy[0].Head   = 1;
            sammy[0].Length = 2;
            sammy[0].Alive  = true;
            sammy[1].Head   = 1;
            sammy[1].Length = 2;
            sammy[1].Alive  = true;
            Inputs[0].Clear();
            Inputs[1].Clear();

            InitColors();

            switch (CurLevel)
            {
            case 1:
                sammy[0].Row       = 25;
                sammy[1].Row       = 25;
                sammy[0].Col       = 50;
                sammy[1].Col       = 30;
                sammy[0].Direction = Direction.Right;
                sammy[1].Direction = Direction.Left;
                break;

            case 2:
                for (int i = 20; i <= 60; i++)
                {
                    Set(25, i, Walls);
                }
                sammy[0].Row       = 7;
                sammy[1].Row       = 43;
                sammy[0].Col       = 60;
                sammy[1].Col       = 20;
                sammy[0].Direction = Direction.Left;
                sammy[1].Direction = Direction.Right;
                break;

            case 3:
                for (int i = 10; i <= 40; i++)
                {
                    Set(i, 20, Walls);
                    Set(i, 60, Walls);
                }
                sammy[0].Row       = 25;
                sammy[1].Row       = 25;
                sammy[0].Col       = 50;
                sammy[1].Col       = 30;
                sammy[0].Direction = Direction.Up;
                sammy[1].Direction = Direction.Down;
                break;

            case 4:
                for (int i = 4; i <= 30; i++)
                {
                    Set(i, 20, Walls);
                    Set(53 - i, 60, Walls);
                }
                for (int i = 2; i <= 40; i++)
                {
                    Set(38, i, Walls);
                    Set(15, 81 - i, Walls);
                }
                sammy[0].Row       = 7;
                sammy[1].Row       = 43;
                sammy[0].Col       = 60;
                sammy[1].Col       = 20;
                sammy[0].Direction = Direction.Left;
                sammy[1].Direction = Direction.Right;
                break;

            case 5:
                for (int i = 13; i <= 39; i++)
                {
                    Set(i, 21, Walls);
                    Set(i, 59, Walls);
                }
                for (int i = 23; i <= 57; i++)
                {
                    Set(11, i, Walls);
                    Set(41, i, Walls);
                }
                sammy[0].Row       = 25;
                sammy[1].Row       = 25;
                sammy[0].Col       = 50;
                sammy[1].Col       = 30;
                sammy[0].Direction = Direction.Up;
                sammy[1].Direction = Direction.Down;
                break;

            case 6:
                for (int i = 4; i <= 49; i++)
                {
                    if (i > 30 || i < 23)
                    {
                        Set(i, 10, Walls);
                        Set(i, 20, Walls);
                        Set(i, 30, Walls);
                        Set(i, 40, Walls);
                        Set(i, 50, Walls);
                        Set(i, 60, Walls);
                        Set(i, 70, Walls);
                    }
                }
                sammy[0].Row       = 7;
                sammy[1].Row       = 43;
                sammy[0].Col       = 65;
                sammy[1].Col       = 15;
                sammy[0].Direction = Direction.Down;
                sammy[1].Direction = Direction.Up;
                break;

            case 7:
                for (int i = 4; i <= 49; i += 2)
                {
                    Set(i, 40, Walls);
                }
                sammy[0].Row       = 7;
                sammy[1].Row       = 43;
                sammy[0].Col       = 65;
                sammy[1].Col       = 15;
                sammy[0].Direction = Direction.Down;
                sammy[1].Direction = Direction.Up;
                break;

            case 8:
                for (int i = 4; i <= 40; i++)
                {
                    Set(i, 10, Walls);
                    Set(53 - i, 20, Walls);
                    Set(i, 30, Walls);
                    Set(53 - i, 40, Walls);
                    Set(i, 50, Walls);
                    Set(53 - i, 60, Walls);
                    Set(i, 70, Walls);
                }
                sammy[0].Row       = 7;
                sammy[1].Row       = 43;
                sammy[0].Col       = 65;
                sammy[1].Col       = 15;
                sammy[0].Direction = Direction.Down;
                sammy[1].Direction = Direction.Up;
                break;

            case 9:
                for (int i = 6; i <= 47; i++)
                {
                    Set(i, i, Walls);
                    Set(i, i + 28, Walls);
                }
                sammy[0].Row       = 40;
                sammy[1].Row       = 15;
                sammy[0].Col       = 75;
                sammy[1].Col       = 5;
                sammy[0].Direction = Direction.Up;
                sammy[1].Direction = Direction.Down;
                break;

            default:
                for (int i = 4; i <= 49; i += 2)
                {
                    Set(i, 10, Walls);
                    Set(i + 1, 20, Walls);
                    Set(i, 30, Walls);
                    Set(i + 1, 40, Walls);
                    Set(i, 50, Walls);
                    Set(i + 1, 60, Walls);
                    Set(i, 70, Walls);
                }
                sammy[0].Row       = 7;
                sammy[1].Row       = 43;
                sammy[0].Col       = 65;
                sammy[1].Col       = 15;
                sammy[0].Direction = Direction.Down;
                sammy[1].Direction = Direction.Up;
                break;
            }
        }