コード例 #1
0
ファイル: AIPlayer.cs プロジェクト: Rodbourn/TexasHoldem
 public AIPlayer(int buyInAmount, DIFFICULTY difficulty, PLAYINGSTYLE playingStyle)
     : base(buyInAmount)
 {
     this.difficulty = (int)difficulty;
     this.playingStyle = (int)playingStyle;
     if (playingStyle == PLAYINGSTYLE.BLUFFER)
     {
         this.Name = "Stewie";
         this.information = "A champion bluffer, Stewie long ago learned the secret of making a fortune with nothing. " +
             "He says, “What am I supposed to do, wait for the cards to go my way? I should live so long.” " +
             "(A joke heard often around here goes, “How can you tell when Stewie is bluffing? His chips are moving!”)";
     }
     else if (playingStyle == PLAYINGSTYLE.AGRESSIVE)
     {
         this.Name = "Rachel";
         this.information = "Don’t let her pretty face fool you. Rachel is what you might call an aggressive player. " +
             "We’ve seen her beat six guys holding two clubs…and that was in the parking lot! " +
             "(The graffiti in our poker room reads, “For a good time, don’t call Rachel. Just fold.”)";
     }
     else if (playingStyle == PLAYINGSTYLE.TIGHT)
     {
         this.Name = "Ray";
         this.information = "A tight player, Ray studied for a career as an accountant, until he calculated it would be too risky. " +
             "He knows the odds of everything, and plays by the numbers. If Ray is putting money in the pot, " +
             "it’s because he expects it back…with interest of course.";
     }
     rand = new Random();
     handValue = 0.5;
 }
コード例 #2
0
ファイル: FloorManager.cs プロジェクト: Pebblz/TurnipKnight
    void Start()
    {
        gameDifficulty               = DIFFICULTY.EASY;
        starting                     = true;
        easyLayouts                  = Resources.LoadAll <GameObject>(@"layouts\Easy").ToList <GameObject>();
        mediumLayouts                = Resources.LoadAll <GameObject>(@"layouts\Medium").ToList <GameObject>();
        hardLayouts                  = Resources.LoadAll <GameObject>(@"layouts\Hard").ToList <GameObject>();
        usedEasyLayouts              = new List <GameObject>(easyLayouts);
        usedMediumLayouts            = new List <GameObject>(mediumLayouts);
        usedHardLayouts              = new List <GameObject>(hardLayouts);
        floors                       = new GameObject[3];
        floors[0]                    = Instantiate(floorPrefab);
        floors[0].transform.position = new Vector3(0, -2, 0);

        floors[1] = Instantiate(floorPrefab);
        float pos = floors[0].transform.position.x + floors[0].GetComponent <FloorScript>().getBigOlLength() + padding;

        floors[1].transform.position = new Vector3(pos, -2, 0);
        floors[2] = Instantiate(floorPrefab);
        floors[2].transform.position = new Vector3(floors[1].transform.position.x + floors[1].GetComponent <FloorScript>().getBigOlLength() + padding, -2, 0);
        for (int i = 0; i < floors.Length; i++)
        {
            for (int j = 0; j < segCount; j++)
            {
                float      segLength = floors[i].GetComponent <FloorScript>().getBigOlLength() / 3f;
                GameObject empty     = (visibleTrapSpawnLocations) ? GameObject.CreatePrimitive(PrimitiveType.Sphere) : new GameObject();
                floors[i].GetComponent <FloorScript>().segs.Add(empty);
                floors[i].GetComponent <FloorScript>().segs[j].transform.position      = new Vector3(0, 800, -segLength + this.transform.position.x + segLength * j);
                floors[i].GetComponent <FloorScript>().segs[j].transform.parent        = floors[i].GetComponent <FloorScript>().transform;
                floors[i].GetComponent <FloorScript>().segs[j].transform.localPosition = new Vector3(0, 420f + 10f, 650f - 650f * j);
            }
            //floors[i].GetComponent<FloorScript>().LoadWalls();
            spawnTrapsOnFloor(i);
        }
    }
コード例 #3
0
 void hardButtonListener()
 {
     difficulty = DIFFICULTY.HARD;
     easyButton.GetComponent <Image>().color   = new Color(255f, 255f, 255f);
     normalButton.GetComponent <Image>().color = new Color(255f, 255f, 255f);
     hardButton.GetComponent <Image>().color   = new Color(255f, 0f, 255f);
 }
コード例 #4
0
ファイル: AIPlayer.cs プロジェクト: zhaojinweipay/TexasHoldem
 public AIPlayer(int buyInAmount, DIFFICULTY difficulty, PLAYINGSTYLE playingStyle)
     : base(buyInAmount)
 {
     this.difficulty = (int)difficulty;
     this.playingStyle = (int)playingStyle;
     if (playingStyle == PLAYINGSTYLE.BLUFFER)
     {
         this.Name = "Stewie";
         this.information = "A champion bluffer, Stewie long ago learned the secret of making a fortune with nothing. " +
             "He says, “What am I supposed to do, wait for the cards to go my way? I should live so long.” " +
             "(A joke heard often around here goes, “How can you tell when Stewie is bluffing? His chips are moving!”)";
     }
     else if (playingStyle == PLAYINGSTYLE.AGRESSIVE)
     {
         this.Name = "Rachel";
         this.information = "Don’t let her pretty face fool you. Rachel is what you might call an aggressive player. " +
             "We’ve seen her beat six guys holding two clubs…and that was in the parking lot! " +
             "(The graffiti in our poker room reads, “For a good time, don’t call Rachel. Just fold.”)";
     }
     else if (playingStyle == PLAYINGSTYLE.TIGHT)
     {
         this.Name = "Ray";
         this.information = "A tight player, Ray studied for a career as an accountant, until he calculated it would be too risky. " +
             "He knows the odds of everything, and plays by the numbers. If Ray is putting money in the pot, " +
             "it’s because he expects it back…with interest of course.";
     }
     rand = new Random();
     handValue = 0.5;
 }
コード例 #5
0
        public override void InitializeGame(DIFFICULTY _dif)
        {
            base.InitializeGame(_dif);
            m_coins  = PC_Casino.Instance.Coins;
            m_wager  = 0;
            m_payout = 0;
            m_replay = false;

            if (m_credit == null)
            {
                m_credit = new PC_SlotMachineScore(PC_Casino.Instance.Coins, this);
            }
            else
            {
                m_credit.Init(PC_Casino.Instance.Coins, this);
            }

            if (m_payOutScore == null)
            {
                m_payOutScore = new PC_SlotMachineScore(0, this);
            }
            else
            {
                m_payOutScore.Init(0, this);
            }

            Sprite[] iconsArray = Resources.LoadAll <Sprite>("Graphics/SlotMachine/images");

            foreach (PC_SlotMachineReel r in m_reels)
            {
                r.InitializeReel((int)_dif, this, iconsArray);
            }
        }
コード例 #6
0
        /// <summary>
        /// Called when the player leaves go of the DIFFICULTY podium lever. Will set the lever to the centre of whichever section it is in. Eg, if in MEDIUM, the lever will be set to the
        /// centre of the MEDIUM section.
        /// </summary>
        /// <param name="diff">The difficulty</param>
        void DifficultySnapToCentre(DIFFICULTY diff)
        {
            Quaternion q = transform.localRotation;

            switch (diff)
            {
            case DIFFICULTY.LIGHTWEIGHT:
                q.eulerAngles = defaultLightweight;
                break;

            case DIFFICULTY.EASY:
                q.eulerAngles = defaultEasy;
                break;

            case DIFFICULTY.MEDIUM:
                q.eulerAngles = defaultMedium;
                break;

            case DIFFICULTY.HARD:
                q.eulerAngles = defaultHard;
                break;

            case DIFFICULTY.DEATH_LIKELY:
                q.eulerAngles = defaultDeathLikely;
                break;
            }
            transform.localRotation = q;
            if (audioSource != null)
            {
                audioSource.Play();
            }
            //   podiumManager.SendDifficultyToGameController();
        }
コード例 #7
0
ファイル: Form1.cs プロジェクト: Xskullibur/Gomoku
        public void reset_board(DIFFICULTY setDifficulty, Object sender)
        {
            if (MessageBox.Show($"Start a new ({setDifficulty}) Game?", "New Game", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
            {
                foreach (Control control in gamePanel.Controls)
                {
                    control.BackgroundImage = null;
                    control.Enabled         = true;
                }

                for (int col = 0; col < BOARD_DIMENTION - 1; col++)
                {
                    for (int row = 0; row < BOARD_DIMENTION - 1; row++)
                    {
                        GAME_BOARD[row, col] = null;
                    }
                }

                turnNumber         = 0;
                turnLbl.Text       = turnStr + turnNumber;
                GameLogic          = new GameLogic(setDifficulty);
                difficultyLbl.Text = $"{difficultyLbl.Text.Split(':')[0]}: {GameLogic.cDifficulty}";
                (sender as victoryForm).Close();
            }
        }
コード例 #8
0
 protected override void SingletonAwakened()
 {
     onDifficultyChanges = new EngineEvent();
     currentDifficulty   = PreferenceManager.Difficulty;
     onDifficultyChanges.AddAction(ChangeSettingsVariables);
     CurrentPrefab = buttonPrefab;
     onDifficultyChanges.Execute();
 }
コード例 #9
0
    public void SetUI(Stats _localStats, Stats stats, DIFFICULTY _difficulty)
    {
        localStats = _localStats;
        difficulty = _difficulty;
        if (_difficulty != DIFFICULTY.MARATHON)
        {
            stats.correct += _localStats.correct;
        }
        else
        {
            if (_localStats.correct > stats.correct)
            {
                stats.correct = _localStats.correct;
            }
        }
        stats.incorrect += _localStats.incorrect;
        if (_localStats.score > stats.score)
        {
            stats.score = _localStats.score;
        }
        GameManager.Instance.config.library.SaveStats();

        scoreText.text           = "Score: " + _localStats.score;
        correctAnswerText.text   = string.Format("Correct Answers: {0}", _localStats.correct);
        incorrectAnswerText.text = string.Format("Incorrect Answers: {0}", _localStats.incorrect);
        accuracyText.text        = string.Format("Accuracy: {0}%", (int)(_localStats.Accuracy * 100f));

        //Star region
        if (_localStats.Accuracy >= 0.95f)
        {
            leftStarOff.enabled   = false;
            middleStarOff.enabled = false;
            rightStarOff.enabled  = false;
        }
        else if (_localStats.Accuracy >= 0.70f)
        {
            leftStarOff.enabled   = false;
            middleStarOff.enabled = false;
            rightStarOff.enabled  = true;
        }
        else if (_localStats.Accuracy >= 0.45f)
        {
            leftStarOff.enabled   = false;
            middleStarOff.enabled = true;
            rightStarOff.enabled  = true;
        }
        else
        {
            leftStarOff.enabled   = true;
            rightStarOff.enabled  = true;
            middleStarOff.enabled = true;
        }

        leftStarOn.enabled   = !leftStarOff.enabled;
        middleStarOn.enabled = !middleStarOff.enabled;
        rightStarOn.enabled  = !rightStarOff.enabled;
    }
コード例 #10
0
 void Start()
 {
     diff = currentDifficulty;
     ChangeDifficultyLabel();
     LanguageManager.Instance.onLanguageChanged.AddAction(ChangeDifficultyLabel);
     sound.value   = PreferenceManager.SoundVolume;
     music.value   = PreferenceManager.MusicVolume;
     language.text = langStrings[(int)LanguageManager.Instance.Language];
 }
コード例 #11
0
        public static DifficultySettings createByDifficulty(DIFFICULTY difficulty)
        {            
            switch (difficulty) {
                case DIFFICULTY.EASY: return new DifficultySettings(DIFFICULTY.EASY);
                case DIFFICULTY.NORMAL: return new DifficultySettings(DIFFICULTY.NORMAL);
                case DIFFICULTY.HARD: return new DifficultySettings(DIFFICULTY.HARD);        
            }

            return null;
        }
コード例 #12
0
 // Use this for initialization
 void Start()
 {
     //RandomizeTasks ();
     checkTasks                        = false;
     tasks                             = new List <Situation>();
     audioSource                       = GetComponent <AudioSource>();
     audioSource.playOnAwake           = false;
     audioSource.outputAudioMixerGroup = directorChannel;
     levelDifficulty                   = DIFFICULTY.EASY;
 }
コード例 #13
0
ファイル: FloorManager.cs プロジェクト: Pebblz/TurnipKnight
 public void setDifficulty()
 {
     if (this.floorCount >= 10)
     {
         gameDifficulty = DIFFICULTY.HARD;
     }
     else if (this.floorCount >= 5)
     {
         gameDifficulty = DIFFICULTY.MEDIUM;
     }
 }
コード例 #14
0
        public static DifficultySettings createByDifficulty(DIFFICULTY difficulty)
        {
            switch (difficulty)
            {
            case DIFFICULTY.EASY: return(new DifficultySettings(DIFFICULTY.EASY));

            case DIFFICULTY.NORMAL: return(new DifficultySettings(DIFFICULTY.NORMAL));

            case DIFFICULTY.HARD: return(new DifficultySettings(DIFFICULTY.HARD));
            }

            return(null);
        }
コード例 #15
0
ファイル: AI.cs プロジェクト: rcLzen/TicTacToe_5X5X4
        public AI(Button[] board, DIFFICULTY diff)
        {
            random = new Random();
            sw = new Stopwatch();
            this.diff = diff;
            this.board = board;
            movesLeft = new List<int>();
            
            bestMove = new int[2];
            bestMove[1] = -100000;

            for (int x = 0; x < 25; x++)
                movesLeft.Add(x);
        }
コード例 #16
0
ファイル: Form1.cs プロジェクト: Xskullibur/Gomoku
        public Form1(DIFFICULTY difficulty, Users user)
        {
            InitializeComponent();

            PLAYER_DIE   = $"{IMAGE_PATH}\\black_die.png";
            COMPUTER_DIE = $"{IMAGE_PATH}\\white_die.png";

            menuTableLayout.BackColor = Color.FromArgb(100, Color.LightGray);
            menuTableLayout.Height    = menuStrip.Height;

            GameLogic   = new GameLogic(difficulty);
            currentUser = user;
            generateBoard();
        }
コード例 #17
0
    //////////
    public static int getRoundRunnerHealth(int iRound, DIFFICULTY iDif)
    {
        double hitpoints;

        if (iRound <= 0)
        {
            return(10);
        }
        if (iDif == DIFFICULTY.NOOB)
        {
            hitpoints = RanaLib.Math.polynom3(iRound, 25, 10, 15, 0);
        }
        else if (iDif == DIFFICULTY.ROOKIE)
        {
            hitpoints = RanaLib.Math.polynom3(iRound, 15, 0, 35, 0);
        }
        else if (iDif == DIFFICULTY.HOTSHOT)
        {
            hitpoints = RanaLib.Math.polynom3(iRound, 50, 21, 28, 1);
        }
        else if (iDif == DIFFICULTY.VETERAN)
        {
            hitpoints = RanaLib.Math.polynom3(iRound, 50, 20, 28, 2);
        }
        else if (iDif == DIFFICULTY.ELITE)
        {
            hitpoints = RanaLib.Math.polynom3(iRound, 40, 80, 0, 6);
        }
        else if (iDif == DIFFICULTY.PSYCHO)
        {
            hitpoints = RanaLib.Math.polynom3(iRound, 64, 128, 0, 10);
        }
        else
        {
            RanaLib.Exception.Throw("Error: Unrecognized difficulty. (getRoundRunnerHealth)");
            return(0);
        }
        if (iRound > Constants.MAX_ROUND)
        {
            hitpoints *= Math.Pow(1.1, iRound - Constants.MAX_ROUND);
        }
        hitpoints = Math.Floor(hitpoints / 25) * 25;
        if (hitpoints < 25)
        {
            hitpoints = 25;
        }

        return((int)hitpoints);
    }
コード例 #18
0
    void RandomizeTasks(DIFFICULTY diff)
    {
        tasks.Clear();
        taskIsDone.Clear();
        Map map = GameObject.FindObjectOfType <Map> ();

        int req1 = 1;
        int req2 = 1;
        int req3 = 1;

        if (diff == DIFFICULTY.MEDIUM)
        {
            req3 = 2;
        }
        else if (diff == DIFFICULTY.HARD)
        {
            req2 = 2;
            req3 = 2;
        }


        int[] numRequirementsArr = new int[3] {
            req1,
            req2,
            req3
        };


        for (int i = 0; i < numTasks; ++i)
        {
            Situation          task       = new Situation();
            List <ACTOR_NAMES> actorNames = new List <ACTOR_NAMES>(activeActors);
            int complexity = numRequirementsArr[i];

            for (int j = 0; j < complexity; ++j)
            {
                int nameChoice  = Random.Range(0, actorNames.Count);
                int stateChoice = Random.Range(0, actor_states.Length);
                task.actorNames.Add(actorNames[nameChoice]);
                actorNames.RemoveAt(nameChoice);
                task.actorStates.Add(ConvertIntToState(stateChoice));
            }
            task.cameraNum = Random.Range(0, cameras.Count);
            Debug.Log(ParseSituation(task, false));
            tasks.Add(task);
            taskIsDone.Add(false);
        }
    }
コード例 #19
0
        public static string DifficultyToString(DIFFICULTY difficulty)
        {
            switch (difficulty)
            {
            case DIFFICULTY.EASY:
                return("EASY");

            case DIFFICULTY.NORMAL:
                return("NORMAL");

            case DIFFICULTY.HARD:
                return("HARD");

            case DIFFICULTY.EXPERT:
            default:
                return("EXPERT");
            }
        }
コード例 #20
0
        public int getScore(int turns, DIFFICULTY cDifficulty)
        {
            int score = maxScore - turns;

            switch (cDifficulty)
            {
            case DIFFICULTY.EASY:
                return(score * easyScoreMultiplier);

            case DIFFICULTY.NORMAL:
                return(score * normalScoreMultiplier);

            case DIFFICULTY.HARD:
                return(score * hardScoreMultiplier);

            default:
                return(0);
            }
        }
コード例 #21
0
ファイル: ShivToTheBeat.cs プロジェクト: jelliott711/Capstone
    private void InitConditions()
    {
        print("TDOWN START STATS:\n");
        int weight = Random.Range(0, 10);

        print("Weight: " + weight + "\n");
        if (weight <= 3)
        {
            gameDiff = DIFFICULTY.EASY;
            print("Diff: EASY(0-3)\n");
            velocity   = new Vector2(0.0f, -5.0f);
            minSepTime = 0.9f;
            maxSepTime = 1.7f;
        }
        else if (weight <= 6)
        {
            gameDiff = DIFFICULTY.MEDIUM;
            print("Diff: Medium(4-6)\n");
            velocity   = new Vector2(0.0f, -7.0f);
            minSepTime = 0.6f;
            maxSepTime = 1.4f;
        }
        else if (weight <= 8)
        {
            gameDiff = DIFFICULTY.HARD;
            print("Diff: Hard(7-8)\n");
            velocity   = new Vector2(0.0f, -10.0f);
            minSepTime = 0.3f;
            maxSepTime = 1.1f;
        }
        else
        {
            gameDiff = DIFFICULTY.MAKE_IT_STOP;
            print("Diff: MIS(9)\n");
            velocity   = new Vector2(0.0f, -15.0f);
            minSepTime = 0.1f;
            maxSepTime = 0.9f;
        }
        gameStyle = STYLE.RAIN;
    }
コード例 #22
0
 public Form1(GameDifficulty Difficulty)
 {
     InitializeComponent();
     isAtStart  = true;
     canMove    = false;
     difficulty = Difficulty.difficulty;
     if (difficulty == DIFFICULTY.easy)
     {
         difficultyPenalty = 5;
     }
     if (difficulty == DIFFICULTY.medium)
     {
         difficultyPenalty = 10;
     }
     if (difficulty == DIFFICULTY.hard)
     {
         difficultyPenalty = 20;
     }
     WORLD_WIDTH  = (int)difficulty;
     WORLD_HEIGHT = (int)difficulty;
     newGame(WORLD_WIDTH, WORLD_HEIGHT);
 }
コード例 #23
0
        public void updateRecords(int turns, DIFFICULTY cDifficulty, string name)
        {
            int           score       = getScore(turns, cDifficulty);
            List <string> scoreboard  = File.ReadAllLines(highscoreFile).ToList();
            bool          playerFound = false;

            for (int i = 0; i < scoreboard.Count; i++)
            {
                if (scoreboard[i].Contains(name))
                {
                    playerFound = true;
                    string[] splittedLine = scoreboard[i].Split(':');
                    score        += Convert.ToInt32(splittedLine[1]);
                    scoreboard[i] = $"{splittedLine[0]}: {score}";
                    File.WriteAllLines(highscoreFile, scoreboard);
                }
            }

            if (playerFound == false)
            {
                scoreboard.Add($"{currentUser.playerName}: {score}");
                File.WriteAllLines(highscoreFile, scoreboard);
            }
        }
コード例 #24
0
        public victoryForm(PLAYER player, int turns, DIFFICULTY difficulty, Form1 currentForm, Users user)
        {
            InitializeComponent();
            form        = currentForm;
            cDifficulty = difficulty;
            currentUser = user;
            scoreboard  = new Scoreboard(currentUser);

            switch (player)
            {
            case PLAYER.player:
                victoryLbl.Text = $"{currentUser.playerName}'s {victoryLbl.Text}";
                scoreboard.updateRecords(turns, difficulty, currentUser.playerName);
                victorySound.Play();
                break;

            case PLAYER.computer:
                victoryLbl.Text     = $"{computerName}'s {victoryLbl.Text}";
                nxtLvlBtn.BackColor = Color.FromArgb(150, Color.Violet);
                nxtLvlBtn.Enabled   = false;
                failureSound.Play();
                break;

            default:
                victoryLbl.Text = "Victory!";
                break;
            }

            turnLbl.Text = $"Score: {scoreboard.getScore(turns, difficulty)}";

            if (difficulty == DIFFICULTY.HARD)
            {
                nxtLvlBtn.BackColor = Color.FromArgb(150, Color.Violet);
                nxtLvlBtn.Enabled   = false;
            }
        }
コード例 #25
0
 private DifficultySettings(DIFFICULTY difficulty)
 {
     this.difficulty = difficulty;
     setDifficultyDependantSettings();
 }
コード例 #26
0
 private DifficultySettings(DIFFICULTY difficulty)
 {
     this.difficulty = difficulty;
     setDifficultyDependantSettings();
 }
コード例 #27
0
        /// <summary>
        /// Sets the difficulty value based on rotation of the lever of the podium that has DIFFICULTY selected from the LEVER TYPE enum dropdown.
        /// The x valeus refer to the rotation of the lever
        /// Teh Y values ideally should only ever be 0 or 180, but the reason I give a bit of leeway is because its often not exactly 0 or exactly 180
        /// </summary>
        void SelectDifficulty()
        {
            if (leverType == LEVERTYPE.DIFFICULTY)
            {
                angle = gameObject.transform.localRotation.eulerAngles;
                if (angle.x >= 52.1 && angle.x <= 89.9)
                {
                    if (angle.y >= -15.0 && angle.y <= 15.0)
                    {
                        difficulty = DIFFICULTY.HARD;
                    }
                }

                if (angle.x <= 90.0 && angle.x >= 75.6)
                {
                    if (angle.y >= 260.0 && angle.y <= 300.0)
                    {
                        difficulty = DIFFICULTY.HARD;
                    }
                }

                if (angle.x <= 75.5 && angle.x >= 59.1)
                {
                    if (angle.y >= 160.0 && angle.y <= 200.0)
                    {
                        // difficulty = DIFFICULTY.DEATH_LIKELY;
                        difficulty = DIFFICULTY.HARD;
                    }
                }

                if (angle.x <= 59.0 && angle.x >= 0.1)
                {
                    if (angle.y >= 160.0 && angle.y <= 195.0)
                    {
                        // difficulty = DIFFICULTY.DEATH_LIKELY; //This is when the lever is on the "Bellinger Telegraph" part.  Its closer to DEATH LIKELY than LIGHTWEIGHT so I just set it to DEATH LIKELY
                        difficulty = DIFFICULTY.HARD;
                    }
                }

                if (angle.x <= 359.9 && angle.x >= 301.7)
                {
                    if (angle.y >= 160.0 && angle.y <= 195.0)
                    {
                        // difficulty = DIFFICULTY.LIGHTWEIGHT; //This is when the lever is on the "Bellinger Telegraph" part. Its closer to LIGHTWEIGHT than DEATH LIKELY so I just set it to LIGHTWEIGHT
                        difficulty = DIFFICULTY.EASY;
                    }
                }

                if (angle.x <= 301.6 && angle.x >= 285.0)
                {
                    if (angle.y >= 160.0 && angle.y <= 195.0)
                    {
                        // difficulty = DIFFICULTY.LIGHTWEIGHT;
                        difficulty = DIFFICULTY.EASY;
                    }
                }

                if (angle.x <= 284.9 && angle.x >= 270.1)
                {
                    if (angle.y >= 160.0 && angle.y <= 195.0)
                    {
                        difficulty = DIFFICULTY.EASY;
                    }
                }

                if (angle.x >= 269.9 && angle.x <= 307.0)
                {
                    if (angle.y >= -15.0 && angle.y <= 15.0)
                    {
                        difficulty = DIFFICULTY.EASY;
                    }
                }

                if (angle.x >= 307.1 && angle.x <= 359.9)
                {
                    if (angle.y >= -15.0 && angle.y <= 15.0)
                    {
                        difficulty = DIFFICULTY.MEDIUM;
                    }
                }

                if (angle.x >= 0.1 && angle.x <= 52.1)
                {
                    if (angle.y >= -15.0 && angle.y <= 15.0)
                    {
                        difficulty = DIFFICULTY.MEDIUM;
                    }
                }
                DifficultySnapToCentre(difficulty);
                // Debug.Log("diff val  " + transform.localRotation.eulerAngles);
            }
        }
コード例 #28
0
 // ------------
 /// <summary>
 /// ゲームの難易度変更
 /// </summary>
 /// <param name="i_mode"></param>
 public void ChangeDifficulty(DIFFICULTY i_mode)
 {
     m_difficulty = i_mode;
     LogUtil.DebugLog(SHConstant.COMMON_CHANGE_DIFFICULTY + m_difficulty);
 }
コード例 #29
0
    IEnumerator DragAnimation(Vector2 dir)
    {
        float time = 0;

        AudioSource.PlayClipAtPoint(SoundManager.soundMgr.esList["UITouch"], Camera.main.transform.position);
        while (true)
        {
            time += Time.deltaTime * 5;


            if (time > 1.3f)
            {
                for (int i = 0; i < difficulties_obj.Length; i++)
                {
                    originPos[i] = difficulties_obj[i].transform.position;
                }

                if (dir == Vector2.right)
                {
                    curDiff++;

                    if (curDiff == DIFFICULTY.HARD + 1)
                    {
                        curDiff = DIFFICULTY.EASY;
                    }
                }

                else
                {
                    curDiff--;

                    if (curDiff == DIFFICULTY.EASY - 1)
                    {
                        curDiff = DIFFICULTY.HARD;
                    }
                }

                SetColor();
                b_drag = false;
                break;
            }

            else
            {
                for (int i = 0; i < difficulties_obj.Length; i++)
                {
                    if (dir == Vector2.right)
                    {
                        if (i == 0)
                        {
                            difficulties_obj[i].transform.position = Vector3.Lerp(originPos[i], originPos[2], time);
                        }
                        else
                        {
                            difficulties_obj[i].transform.position = Vector3.Lerp(originPos[i], originPos[i - 1], time);
                        }
                    }

                    else
                    {
                        if (i == 2)
                        {
                            difficulties_obj[i].transform.position = Vector3.Lerp(originPos[i], originPos[0], time);
                        }
                        else
                        {
                            difficulties_obj[i].transform.position = Vector3.Lerp(originPos[i], originPos[i + 1], time);
                        }
                    }
                }
            }


            yield return(null);
        }
    }
コード例 #30
0
 public void SetDifficulty(DIFFICULTY diff)
 {
     currentDifficulty = diff;
     onDifficultyChanges.Execute();
 }
コード例 #31
0
 public GameDifficulty(DIFFICULTY Difficulty)
 {
     difficulty = Difficulty;
 }
コード例 #32
0
 private void difficultyCombo_SelectedIndexChanged(object sender, EventArgs e)
 {
     cDifficulty = (DIFFICULTY)difficultyCombo.SelectedValue;
 }
コード例 #33
0
    // Update is called once per frame
    void Update()
    {
        if (initializeLevel)
        {
            initializeLevel = false;
            lvlCounter      = 1;
            InitializeUIElements();
            ResetLevel();
            StartNewLevel();
        }



        if (checkTasks && !timerFinished)
        {
            int    numTasksDone = 0;
            string UIText       = string.Empty;
            for (int i = 0; i < tasks.Count; ++i)
            {
                Situation s = BuildSituation(tasks [i].cameraNum);
                if (!taskIsDone[i])
                {
                    if (CheckConditiosnEASY(s, i))
                    {
                        taskIsDone [i] = true;
                        Debug.Log(ParseSituation(s, taskIsDone[i]));
                        Debug.Log("Is done!");
                        PlaySound(Random.Range(1, 4), 0);
                    }
                }
                else
                {
                    numTasksDone++;
                }
                UIText += ParseSituation(tasks[i], taskIsDone [i]);
            }
            uiTaskUpdater.SetCurrentTask(UIText);
            if (numTasksDone == tasks.Count)
            {
                PlaySound(7, 0);
                Debug.Log("YOU WIN");
                gameState = GAME_STATE.WIN;
                uiTaskUpdater.WinGameText();
                checkTasks = false;
            }
        }

        if (!timerFinished)
        {
            levelTimeLimitTimer += Time.deltaTime;
            if (levelTimeLimitTimer > levelTimeLimit)
            {
                timerFinished = true;
                Debug.Log("Time is finished");
                if (checkTasks)
                {
                    gameState = GAME_STATE.LOSE;
                    PlaySound(Random.Range(4, 7), 0);
                    uiTaskUpdater.LoseGameText();
                }
            }

            if (uiUpdater != null)
            {
                uiUpdater.UpdateUI(1.0f - levelTimeLimitTimer / levelTimeLimit);
            }
            else
            {
                Debug.Log("UI Updater not found");
            }
        }

        if (gameState == GAME_STATE.PLAYING)
        {
        }
        else if (gameState == GAME_STATE.WIN)
        {
            //Call Winning Animation

            if (levelDifficulty == DIFFICULTY.EASY)
            {
                levelDifficulty = DIFFICULTY.MEDIUM;
            }
            else if (levelDifficulty == DIFFICULTY.MEDIUM)
            {
                levelDifficulty = DIFFICULTY.HARD;
            }


            GameObject.Find("Camera").GetComponent <GameOver>().GameOverActivate(true);
            StartCoroutine(PrepareNewLevel());
            lvlCounter++;
            gameState = GAME_STATE.WAITING;
        }
        else if (gameState == GAME_STATE.LOSE)
        {
            //Call Losing Animation
            GameObject.Find("Camera").GetComponent <GameOver>().GameOverActivate(false);
            GameObject.FindGameObjectWithTag("UI").GetComponent <ShowPanels>().EnableGameOverButtons();
            GameObject.FindGameObjectWithTag("UI").GetComponent <ShowPanels>().GameOverActivate();
            gameState = GAME_STATE.WAITING;
        }
        else if (gameState == GAME_STATE.WAITING)
        {
        }
    }
コード例 #34
0
ファイル: Player.cs プロジェクト: rcLzen/TicTacToe_5X5X4
 //the difficulty level method is invoked
 public void setDifficulty(DIFFICULTY diff)
 {
     switch(diff)
     {
         //sets the modifier value for Medium level
         case DIFFICULTY.Medium: maxScore *= 5;
             modifier *= 5;
             break;
         //sets the modifier value for Hard level
         case DIFFICULTY.Hard: maxScore *= 15;
             modifier *= 15;
             break;
     }
 }
コード例 #35
0
 /// <summary>
 /// Initialize common data
 /// </summary>
 /// <param name="_dif"></param>
 public virtual void InitializeGame(DIFFICULTY _dif)
 {
     m_gameDifficulty = _dif;
     PC_AudioManager.PlayBGM(m_bgmClip);
     PC_EventManager.TriggerEvent(PC_EventSetup.LOAD_GAME);
 }