Пример #1
0
        public static SelectableData GetDifficltySelectableData(difficulty difficulty)
        {
            SelectableData data;

            switch (difficulty)
            {
            case difficulty.EASY:
                Debug.Log("Select EASY");
                data = new SelectableData(5, 1.5f, 0.15f, 2000, 1.2f, 1.0f, 120);
                break;

            case difficulty.NOMAL:
                Debug.Log("Select NOMAL");
                data = new SelectableData(3, 1.0f, 0.1f, 3000, 1.0f, 1.0f, 90);
                break;

            case difficulty.HARD:
                Debug.Log("Select HARD");
                data = new SelectableData(1, 0.8f, 0.08f, 4000, 0.8f, 0.8f, 60);
                break;

            default:
                data = null;
                break;
            }

            return(data);
        }
Пример #2
0
    private void changeBreathDifficulty(difficulty diff)
    {
        // 0 = Slowest/Deepest, 1 = Slow/Deep, 2 = Medium, 3 = Fast/Shallow
        int diffInt;

        switch (diff)
        {
        case difficulty.Deepest:
            diffInt = 0;
            break;

        case difficulty.Deep:
            diffInt = 1;
            break;

        case difficulty.Normal:
            diffInt = 2;
            break;

        case difficulty.Quick:
            diffInt = 3;
            break;

        default:
            diffInt = 2;
            break;
        }
        changeDifficultyEvent.Raise(diffInt);
    }
Пример #3
0
 void Awake()
 {
     MakeSingleton();
     ResetTimerSpeed();
     set_difficulty = difficulty.EASY;
     achievements   = new bool[numberOfAchievements];
 }
Пример #4
0
    public override void gameStart(difficulty difficulty)
    {
        if (UnityEngine.Random.Range(0, 101) < 50)
        {
            spaceToWin = true;
        }

        if (UnityEngine.Random.Range(0, 101) < 50)
        {
            text.transform.eulerAngles = new Vector3(0, 0, 180);
        }

        if (spaceToWin)
        {
            if (UnityEngine.Random.Range(0, 101) < 50)
            {
                text.GetComponent <TextMesh>().text = "backspace to lose \n \n Space to win";
            }
            else
            {
                text.GetComponent <TextMesh>().text = "Space to win \n \n backspace to lose";
            }
        }
        else
        {
            if (UnityEngine.Random.Range(0, 101) < 50)
            {
                text.GetComponent <TextMesh>().text = "Space to lose \n \n backspace to win";
            }
            else
            {
                text.GetComponent <TextMesh>().text = "backspace to win \n \n Space to lose";
            }
        }
    }
Пример #5
0
        private static void saveScores(difficulty d, SortedList <Score, Score> scores)
        {
            switch (d)
            {
            case difficulty.EASY:
                using (FileStream stream = new FileStream("Assets/easy.lst", FileMode.Create))
                {
                    IFormatter formatter = new BinaryFormatter();
                    formatter.Serialize(stream, scores);
                    stream.Close();
                }
                break;

            case difficulty.INTERMEDIATE:
                using (FileStream stream = new FileStream("Assets/medium.lst", FileMode.Create))
                {
                    IFormatter formatter = new BinaryFormatter();
                    formatter.Serialize(stream, scores);
                    stream.Close();
                }
                break;

            case difficulty.HARD:
                using (FileStream stream = new FileStream("Assets/hard.lst", FileMode.Create))
                {
                    IFormatter formatter = new BinaryFormatter();
                    formatter.Serialize(stream, scores);
                    stream.Close();
                }
                break;

            default:
                break;
            }
        }
Пример #6
0
        public static int GetNextMove(difficulty dif, GFX.Player p = GFX.Player.O)
        {
            int d;

            if (dif == difficulty.Easy)
            {
                d = 1;
            }
            else
            {
                d = 9;
            }
            GFX.Player[] b;
            GFX.Player[] old = Logic.board;
            minimax(d, int.MinValue + 1, int.MaxValue - 1, true, p, Logic.board, out b);
            if (b != null)
            {
                Logic.board = b;
            }
            for (int i = 0; i < 9; i++)
            {
                if (old[i] != b[i])
                {
                    return(i);
                }
            }
            return(-1);
        }
Пример #7
0
        private static SortedList <Score, Score> getScores(difficulty d)
        {
            SortedList <Score, Score> scores;

            switch (d)
            {
            case difficulty.EASY:
                try
                {
                    using (FileStream stream = new FileStream("Assets/easy.lst", FileMode.Open))
                    {
                        IFormatter formatter = new BinaryFormatter();
                        scores = (SortedList <Score, Score>)formatter.Deserialize(stream);
                        stream.Close();
                    }
                }
                catch (FileNotFoundException)
                {
                    scores = new SortedList <Score, Score>();
                }
                break;

            case difficulty.INTERMEDIATE:
                try
                {
                    using (FileStream stream = new FileStream("Assets/medium.lst", FileMode.Open))
                    {
                        IFormatter formatter = new BinaryFormatter();
                        scores = (SortedList <Score, Score>)formatter.Deserialize(stream);
                        stream.Close();
                    }
                }
                catch (FileNotFoundException)
                {
                    scores = new SortedList <Score, Score>();
                }
                break;

            case difficulty.HARD:
                try
                {
                    using (FileStream stream = new FileStream("Assets/hard.lst", FileMode.Open))
                    {
                        IFormatter formatter = new BinaryFormatter();
                        scores = (SortedList <Score, Score>)formatter.Deserialize(stream);
                        stream.Close();
                    }
                }
                catch (FileNotFoundException)
                {
                    scores = new SortedList <Score, Score>();
                }
                break;

            default:
                scores = new SortedList <Score, Score>();
                break;
            }
            return(scores);
        }
Пример #8
0
        public Menu()
        {
            Play         = new Button(new Point(140, 50), Resources.btnPlayDark, Resources.btnPlay, 150, 70);
            Achiev       = new Button(new Point(140, 130), Resources.btnAchievDark, Resources.btnAchiev, 150, 70);
            Leaderboards = new Button(new Point(140, 210), Resources.btnLeadDark, Resources.btnLead, 150, 70);
            Quit         = new Button(new Point(140, 290), Resources.btnQuitDark, Resources.btnQuit, 150, 70);
            Easy         = new Button(new Point(55, 375), Resources.btnEasyDark, Resources.btnEasy, 90, 90);
            Medium       = new Button(new Point(175, 375), Resources.btnMediumDark, Resources.btnMedium, 90, 90);
            Hard         = new Button(new Point(295, 375), Resources.btnHardDark, Resources.btnHard, 90, 90);
            Diff         = difficulty.EASY;
            Easy.Clicked = true;
            InitializeComponent();
            this.BackgroundImage = Resources.background;
            DoubleBuffered       = true;
            skinImage            = new ImageWrapper(Resources.mine);
            skinImage.getImage().Tag = "Mine";

            // try read from file, if can -> overwrite this ^ list
            if (LoadAchievements() != null)
            {
                achievements = LoadAchievements();
            }
            else
            {
                achievements = new List <Achievement>();
                achievements.Add(new Achievement("Baloon", Resources.baloon, Resources.baloonLocked, 45, difficulty.EASY));
                achievements.Add(new Achievement("Nuke", Resources.nuke, Resources.nukeLocked, 15, difficulty.EASY));
                achievements.Add(new Achievement("Poison", Resources.poison, Resources.poisonLocked, 240, difficulty.INTERMEDIATE));
                achievements.Add(new Achievement("Shuriken", Resources.shuriken, Resources.shurikenLocked, 120, difficulty.INTERMEDIATE));
                achievements.Add(new Achievement("Trap", Resources.trap, Resources.trapLocked, 600, difficulty.HARD));
                achievements.Add(new Achievement("Bomb", Resources.bomb, Resources.bombLocked, 480, difficulty.HARD));
            }
        }
Пример #9
0
 public ThingToSpawn(GameObject _prefab, Vector3 _position, Vector3[] _waypoints, float _timer, difficulty difficulty)
 {
     prefab    = _prefab;
     position  = _position;
     waypoints = _waypoints;
     timer     = _timer;
     dif       = difficulty;
 }
Пример #10
0
 /// <summary>
 /// Runs when a new Round is started in a game to clear stored results
 /// </summary>
 public override void NewRound()
 {
     //clear previous round's shot fired
     firedShotLandingX.Clear();
     fireShotLandingY.Clear();
     shotHit.Clear();
     // change the aiSetting
     aiSetting = (difficulty)2;
 }
Пример #11
0
 /// <summary>
 /// constructor of AI player
 /// </summary>
 /// <param name="name"></param>
 /// <param name="tank"></param>
 /// <param name="colour"></param>
 public AIOpponent(string name, TankModel tank, Color colour) : base(name, tank, colour)
 {
     // call constructors for private variables
     firedShotLandingX = new List <float>();
     fireShotLandingY  = new List <float>();
     shotHit           = new List <bool>();
     myRandom          = new Random();
     aiSetting         = (difficulty)2;
 }
    // Use this for initialization
    void Awake()
    {
        dsc = gameObject.GetComponent <DivisionScoreControl> ();

        switch (chooseMode.setDifficulty)
        {
        case 1:
            CurrentDifficulty = difficulty.hard;
            break;

        case 2:
            CurrentDifficulty = difficulty.normal;
            break;

        case 3:
            CurrentDifficulty = difficulty.easy;
            break;

        default:
            Debug.LogError("Unable to set difficulty in division mode");
            break;
        }

        switch (CurrentDifficulty)
        {
        case difficulty.easy:
            for (int i = 0; i < 4; i++)
            {
                dsc.indexOnOff [i] = true;
            }
            dsc.indexAdditionMinMax = new Vector2(2f, 3f);
            break;

        case difficulty.normal:
            for (int i = 0; i < 5; i++)
            {
                dsc.indexOnOff [i] = true;
            }
            dsc.indexAdditionMinMax = new Vector2(3f, 5f);
            dsc.highIndexStart      = 3;
            dsc.highIndexMinMax     = new Vector2(0f, 1f);
            break;

        case difficulty.hard:
            for (int i = 0; i < dsc.indexOnOff.Length; i++)
            {
                dsc.indexOnOff [i] = true;
            }
            dsc.indexAdditionMinMax = new Vector2(5f, 7f);
            dsc.highIndexStart      = 3;
            dsc.highIndexMinMax     = new Vector2(0f, 3f);
            break;
        }
        chooseMode.isGameLoaded = true;
    }
Пример #13
0
 public void SetDifficulty(string s)
 {
     if (s == "easy")
     {
         d = difficulty.easy;
     }
     if (s == "hard")
     {
         d = difficulty.hard;
     }
 }
Пример #14
0
 public Achievement(string name, Image image, Image locked, int secondsRequired, difficulty diffRequired)
 {
     this.name            = name;
     this.image           = image;
     this.image.Tag       = name;
     this.locked          = locked;
     this.locked.Tag      = "Locked" + name;
     this.isUnlocked      = false;
     this.secondsRequired = secondsRequired;
     this.diffRequired    = diffRequired;
 }
Пример #15
0
 public Map(List<Note> TimeMap, string title, string artist, int length, difficulty difficulty,
             string path, int offset, float bpm)
 {
     _timeMap = TimeMap;
     Title = title;
     Artist = artist;
     Length = length;
     Difficulty = difficulty;
     Path = path;
     Offset = offset;
     Bpm = bpm;
 }
Пример #16
0
 public MapPreview(string filePath, string title, string artist, int length, difficulty difficulty,
                   string path, int offset, float bpm)
 {
     FilePath   = filePath;
     Title      = title;
     Artist     = artist;
     Length     = length;
     Difficulty = difficulty;
     Path       = path;
     Offset     = offset;
     Bpm        = bpm;
 }
Пример #17
0
 public MapPreview(string filePath, string title, string artist, int length, difficulty difficulty,
             string path, int offset, float bpm)
 {
     FilePath = filePath;
     Title = title;
     Artist = artist;
     Length = length;
     Difficulty = difficulty;
     Path = path;
     Offset = offset;
     Bpm = bpm;
 }
Пример #18
0
 public Map(List <Note> TimeMap, string title, string artist, int length, difficulty difficulty,
            string path, int offset, float bpm)
 {
     _timeMap   = TimeMap;
     Title      = title;
     Artist     = artist;
     Length     = length;
     Difficulty = difficulty;
     Path       = path;
     Offset     = offset;
     Bpm        = bpm;
 }
Пример #19
0
        public Game(difficulty d, ImageWrapper s, List <Achievement> achievements)
        {
            this.skin = s.getImage();
            DIFF      = difficulty.NONE;

            this.DoubleBuffered = true;

            //default tile size

            InitializeComponent();
            this.achievements = achievements;
            newGame(d);
        }
Пример #20
0
        public Exercise generateNewWorkout(difficulty difficulty)
        {
            List <workoutTypes> applicableWorkoutTypes = workoutPrefs.Keys.Where(r => workoutPrefs[r] < staticRandom.Instance.NextDouble()).ToList();
            //Set defaults if applicableGroups are null
            workoutTypes workoutType = workoutTypes.ActiveRecovery;

            if (applicableWorkoutTypes.Count != 0)
            {
                workoutType = applicableWorkoutTypes[staticRandom.Instance.Next(0, applicableWorkoutTypes.Count - 1)];
            }
            Exercise exercise = new Exercise(workoutType, timeAmounts, amountRange, staticRandom.Instance.Next(exerciseAmount[0], exerciseAmount[1]), difficulty, likedExercises, dislikedExercises);

            return(exercise);
        }
Пример #21
0
        public static void checkScoresAchievs(difficulty DIFF, int seconds, List <Achievement> achievements)
        {
            SortedList <Score, Score> highScores = getScores(DIFF);
            bool f = false;

            for (int i = 0; i < 10; i++)
            {
                if (highScores.Count <= i || highScores.Keys[i].Minutes * 60 + highScores.Keys[i].Seconds > seconds)
                {
                    f = true;
                    break;
                }
            }
            if (f)
            {
                Name form = new Name();
                if (form.ShowDialog() == DialogResult.OK)
                {
                    string name = form.name;
                    Score  temp = new Score(name, seconds / 60, seconds % 60);
                    highScores.Add(temp, temp);
                }
                while (highScores.Count > 10)
                {
                    highScores.RemoveAt(highScores.Count - 1);
                }
            }
            saveScores(DIFF, highScores);
            bool changes = false;

            foreach (var item in achievements)
            {
                if (item.diffRequired == DIFF && item.secondsRequired >= seconds && !item.iSUnlocked())
                {
                    item.Unlock();
                    MessageBox.Show("Congratulations, you unlocked " + item.getName());
                    changes = true;
                }
            }
            if (changes) // if achievements unlocked, save the changes
            {
                using (FileStream stream = new FileStream("Assets/achievements.lst", FileMode.Create))
                {
                    IFormatter formatter = new BinaryFormatter();
                    formatter.Serialize(stream, achievements);
                    stream.Close();
                }
            }
        }
Пример #22
0
 //the main startup function, add a difficulty parameter etc here
 public void startGameUp(difficulty difficultyClass)
 {
     score                     = 0;                            //set the score to 0
     droprate                  = difficultyClass.dropRate;     //get droprate from difficulty object
     enemyMovementSpeed        = difficultyClass.descendSpeed; //get enemy movement speed from difficulty object
     difficultyGrid.Visibility = Visibility.Hidden;            //hide difficulty selection grid
     submitForm.Visibility     = Visibility.Hidden;            //hide submitForm
     gameOverText.Visibility   = Visibility.Hidden;            //hide gameOverText
     addNewBall();                                             //add a ball
     //place a player on the screen in the middle
     addPlayer(1);                                             //add the local player
     startButton.Visibility = Visibility.Hidden;               //hide the start game button
     spawnCounter           = spawnInterval;                   // spawn a new line of enemies on the first tick of the game
     mainLoop.Start();                                         //start the dispatchertimer
 }
Пример #23
0
 /// <summary>
 /// Change the agent's model
 /// </summary>
 public void ChangeModel(difficulty difficulty)
 {
     if (difficulty == difficulty.easy)
     {
         this.GetComponent <BehaviorParameters>().Model = EasyModel;
     }
     else if (difficulty == difficulty.medium)
     {
         this.GetComponent <BehaviorParameters>().Model = MediumModel;
     }
     else if (difficulty == difficulty.hard)
     {
         this.GetComponent <BehaviorParameters>().Model = HardModel;
     }
 }
    // Use this for initialization
    void Awake()
    {
        ssc = gameObject.GetComponent <SubtractionScoreControl> ();

        switch (chooseMode.setDifficulty)
        {
        case 1:
            CurrentDifficulty = difficulty.hard;
            break;

        case 2:
            CurrentDifficulty = difficulty.normal;
            break;

        case 3:
            CurrentDifficulty = difficulty.easy;
            break;

        default:
            Debug.LogError("Unable to set difficulty in subtraction mode");
            break;
        }

        switch (CurrentDifficulty)
        {
        case difficulty.easy:
            ssc.targetMinMax   = new Vector2(0f, 100f);
            ssc.distanceMinMax = new Vector2(30f, 50f);
            ssc.BanSwitch      = false;
            break;

        case difficulty.normal:
            ssc.targetMinMax   = new Vector2(0f, 100f);
            ssc.distanceMinMax = new Vector2(50f, 80f);
            ssc.bannedMinMax   = new Vector2(0f, 9f);
            ssc.BanSwitch      = true;
            ssc.bannedMode     = false;
            break;

        case difficulty.hard:
            ssc.targetMinMax   = new Vector2(0f, 100f);
            ssc.distanceMinMax = new Vector2(80f, 100f);
            ssc.bannedMinMax   = new Vector2(12f, 98f);
            ssc.BanSwitch      = true;
            ssc.bannedMode     = true;
            break;
        }
    }
Пример #25
0
 void set_spawner(difficulty current_difficulty)
 {
     if (current_diff == difficulty.very_easy)
     {
         time_to_spawn        = 20;
         enemy_multiplier     = 1;
         num_enemies          = Random.Range(5, 7);
         enemy_list           = enemy_list_1;
         difficulty_text.text = "Difficulty: Very Easy";
     }
     else if (current_diff == difficulty.easy)
     {
         time_to_spawn        = 20;
         enemy_multiplier     = 1;
         num_enemies          = Random.Range(5, 8);
         difficulty_text.text = "Difficulty: Easy";
     }
     else if (current_diff == difficulty.medium)
     {
         time_to_spawn        = 20;
         enemy_multiplier     = 1.5f;
         num_enemies          = Random.Range(6, 8);
         enemy_list           = enemy_list_2;
         difficulty_text.text = "Difficulty: Medium";
     }
     else if (current_diff == difficulty.hard)
     {
         time_to_spawn        = 18;
         enemy_multiplier     = 1.5f;
         num_enemies          = Random.Range(6, 9);
         difficulty_text.text = "Difficulty: Hard";
     }
     else if (current_diff == difficulty.insane)
     {
         time_to_spawn        = 18;
         enemy_multiplier     = 2f;
         num_enemies          = Random.Range(7, 9);
         enemy_list           = enemy_list_3;
         difficulty_text.text = "Difficulty: Insanse";
     }
     else if (current_diff == difficulty.cyborg_hell)
     {
         time_to_spawn        = 18;
         enemy_multiplier     = 2f;
         num_enemies          = Random.Range(8, 10);
         difficulty_text.text = "Difficulty: Cyborg Hell";
     }
 }
Пример #26
0
    // Update is called once per frame
    void FixedUpdate()
    {
        destroyer.transform.position = new Vector3(0, mainCamera.transform.position.y - halfHeight - (destroyer.transform.localScale.y / 2), 0);

        currentHeight = int.Parse(highScore.text);
        if (currentHeight >= 50 && currentDifficulty == difficulty.EASY)
        {
            currentDifficulty = difficulty.MEDIUM;
            Debug.Log("Medium");
        }
        else if (currentHeight >= 150 && currentDifficulty == difficulty.MEDIUM)
        {
            currentDifficulty = difficulty.HARD;
            Debug.Log("HARD");
        }
    }
Пример #27
0
/// <summary>
/// sets up the general initial state of the minigame
/// </summary>
/// <param name="difficulty">the difficulty of this game</param>
/// <param name="gm">the current game manager</param>
    public void minigameAwake(difficulty difficulty, GameManager gm)
    {
        gameManager = gm;
        if (difficulty == difficulty.MEDIUM)
        {
            time = mediumTime;
        }
        else if (difficulty == difficulty.HARD)
        {
            time = hardTime;
        }
        timerGUI.setFullTime(time);

        gameActive = true;
        minigameContainer.SetActive(true);
        gameStart(difficulty);
    }
Пример #28
0
    // Use this for initialization
    void Awake()
    {
        asc = gameObject.GetComponent <AdditionScoreControl> ();

        switch (chooseMode.setDifficulty)
        {
        case 1:
            CurrentDifficulty = difficulty.hard;
            break;

        case 2:
            CurrentDifficulty = difficulty.normal;
            break;

        case 3:
            CurrentDifficulty = difficulty.easy;
            break;

        default:
            Debug.LogError("Unable to set difficulty in addition mode");
            break;
        }

        switch (CurrentDifficulty)
        {
        case difficulty.easy:
            asc.targetMinMax = new Vector2(50f, 100f);
            asc.BanSwitch    = false;
            break;

        case difficulty.normal:
            asc.targetMinMax = new Vector2(50f, 100f);
            asc.bannedMinMax = new Vector2(1f, 9f);
            asc.BanSwitch    = true;
            asc.bannedMode   = false;                                                           //尾數禁止
            break;

        case difficulty.hard:
            asc.targetMinMax = new Vector2(100f, 200f);
            asc.bannedMinMax = new Vector2(12f, 98f);
            asc.BanSwitch    = true;
            asc.bannedMode   = true;                                                            //所有數禁止
            break;
        }
    }
    public override void gameStart(difficulty difficulty)
    {
        if (difficulty == difficulty.EASY)
        {
            astroidSpawn.rate = easyRate;
        }
        else if (difficulty == difficulty.MEDIUM)
        {
            astroidSpawn.rate = mediumRate;
        }
        else if (difficulty == difficulty.HARD)
        {
            astroidSpawn.rate = hardRate;
        }

        StartCoroutine(astroidSpawn.spawnAsteroids());
        player.die += lose;
    }
Пример #30
0
        public Game(difficulty d, ImageWrapper s, List <Achievement> achievements)
        {
            this.skin = s;
            DIFF      = difficulty.NONE;

            this.DoubleBuffered = true;
            this.BackColor      = Color.LightGray;

            //default tile size
            resizeHold = true;

            resizeHold = false;

            InitializeComponent();
            HeightOffset      = miniMenu.Height + button1.Height + 15;
            this.achievements = achievements;
            newGame(d);
        }
Пример #31
0
    public math_questions(difficulty diff)
    {
        switch (diff)
        {
        case difficulty.Easy:
            question_range = new range(0, 10);
            break;

        case difficulty.Normal:
            question_range = new range(10, 20);
            break;

        case difficulty.Hard:
            question_range = new range(20, 50);
            break;

        default:
            question_range = new range(0, 10);
            break;
        }
        Random random = new Random();

        math_operator = RandomEnumValue <operators>();
        first_value   = random.Next(question_range.min, question_range.max);
        second_value  = random.Next(question_range.min, question_range.max);
        switch (math_operator)
        {
        case operators.Addition:
            answer = first_value + second_value;
            break;

        case operators.Subtraction:
            answer = first_value - second_value;
            break;

        case operators.Multiplication:
            answer = first_value * second_value;
            break;

        default:
            answer = 0;
            break;
        }
    }
Пример #32
0
 void set_spawner(difficulty current_difficulty)
 {
     if (current_diff == difficulty.very_easy)
     {
         time_to_spawn    = 20;
         enemy_multiplier = 1;
         num_enemies      = Random.Range(3, 5);
         max_enemy        = 1;
     }
     else if (current_diff == difficulty.easy)
     {
         time_to_spawn    = 20;
         enemy_multiplier = 1;
         num_enemies      = Random.Range(5, 7);
     }
     else if (current_diff == difficulty.medium)
     {
         time_to_spawn    = 20;
         enemy_multiplier = 1.5f;
         num_enemies      = Random.Range(5, 7);
         max_enemy        = 2;
     }
     else if (current_diff == difficulty.hard)
     {
         time_to_spawn    = 18;
         enemy_multiplier = 1.5f;
         num_enemies      = Random.Range(6, 9);
     }
     else if (current_diff == difficulty.insane)
     {
         time_to_spawn    = 18;
         enemy_multiplier = 2f;
         num_enemies      = Random.Range(6, 9);
         max_enemy        = 3;
     }
     else if (current_diff == difficulty.cyborg_hell)
     {
         time_to_spawn    = 16;
         enemy_multiplier = 2f;
         num_enemies      = Random.Range(7, 11);
     }
 }
Пример #33
0
		public int this [difficulty d]
		{
			get {return MazeQueue(d).Count;}
		}
Пример #34
0
        /// <summary>
        /// Event handler for when the Ungulate menu entry is selected.
        /// </summary>
        void DifficultyMenuEntrySelected(object sender, PlayerIndexEventArgs e)
        {
            currentDifficulty++;

            if (currentDifficulty > difficulty.hard)
                currentDifficulty = 0;

            SetMenuEntryText();
        }
Пример #35
0
		private int DesiredMapSize (difficulty d)
		{
			return MapSizes[(int)d];
		}
Пример #36
0
		public Maze GetMaze (difficulty d)
		{
			return (Maze)MazeQueue(d).Dequeue();
		}
Пример #37
0
		public int QueryMazeCount (difficulty d)
		{
			return MazeQueue(d).Count;
		}
Пример #38
0
 //the main startup function, add a difficulty parameter etc here
 public void startGameUp(difficulty difficultyClass)
 {
     score = 0; //set the score to 0
     droprate = difficultyClass.dropRate;//get droprate from difficulty object
     enemyMovementSpeed = difficultyClass.descendSpeed;//get enemy movement speed from difficulty object
     difficultyGrid.Visibility = Visibility.Hidden;//hide difficulty selection grid
     submitForm.Visibility = Visibility.Hidden;//hide submitForm
     gameOverText.Visibility = Visibility.Hidden;//hide gameOverText
     addNewBall();//add a ball
     //place a player on the screen in the middle
     addPlayer(1);//add the local player
     startButton.Visibility = Visibility.Hidden; //hide the start game button
     spawnCounter = spawnInterval; // spawn a new line of enemies on the first tick of the game
     mainLoop.Start();//start the dispatchertimer
 }
Пример #39
0
		private Queue MazeQueue (difficulty d)
		{
			//return (Queue)((Queue)_MazeQueues[d]).SyncRoot;
			return (Queue)_MazeQueues[d];
		}