当前位置: 首页>>代码示例>>C#>>正文


C# Difficulty.ToString方法代码示例

本文整理汇总了C#中Difficulty.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Difficulty.ToString方法的具体用法?C# Difficulty.ToString怎么用?C# Difficulty.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Difficulty的用法示例。


在下文中一共展示了Difficulty.ToString方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: WinningScreen

        public WinningScreen(Texture2D background, Texture2D buttonTex, SpriteFont font, Color color, Difficulty difficulty,Texture2D control, Player player, bool superShipWasAvailable, bool superShipAvailable, TimeSpan TotalTime, Rectangle window, SoundBank soundBack)
            : base(background, WallpaperType.Streched, buttonTex, font, window, soundBack)
        {
            this.playerTex = player.GetTexture;
            this.control = control;

            this.AddButton("Play Again", color, new Vector2(buttonTex.Width / 2f + buttonTex.Height / 3f, window.Height - buttonTex.Height / 3f));
            this.AddButton("Exit", color, new Vector2(buttonTex.Width * 2f + buttonTex.Height / 3f, window.Height - buttonTex.Height / 3f));

            this.AddLabel("Well Done! You have finished the game!", new Vector2(50));

            float w = window.Width / 2f-150;
            float h = window.Height / 14f;
            float t = 100;

            this.AddLabel("Bullets fired : " + player.GetBulletsFired,new Vector2(w,h+t));
            this.AddLabel("      Accuracy: " + player.GetBulletsAccuracy + "%", new Vector2(w, h * 2 + t));
            this.AddLabel("Missiles fired: " + player.GetMissilesFired, new Vector2(w, h * 3 + t));
            this.AddLabel("      Accuracy: " + player.GetMissilesAccuracy + "%", new Vector2(w, h * 4 + t));
            this.AddLabel("Total Accuracy: " + player.GetTotalAccuracy + "%", new Vector2(w, h * 5 + t));
            this.AddLabel("MidKits Used  : " + player.GetMidkitsUsed, new Vector2(w, h * 6 + t));
            this.AddLabel("Player Score  : " + player.GetPlayerScore , new Vector2(w, h * 7 + t));
            this.AddLabel("Time played     " + TotalTime.Hours +":" + TotalTime.Minutes + ":" + TotalTime.Seconds , new Vector2(w, h * 8 + t));

            this.AddAnimation( new Animation(playerTex, new Point(4, 1),new Vector2(100,window.Height/2f),20,true,font,difficulty.ToString(),window));
            this.AddAnimation( new Animation(control,new Point(1,3),new Vector2(150,window.Height/2f+100),700,false,font,"",window));

            if (superShipAvailable && !superShipWasAvailable)
                this.AddLabel("*Congratulations!! You've unlocked a new ship,The ultimate ship.", new Vector2(100, h * 9f + t));
        }
开发者ID:urgamedev,项目名称:code-monogame,代码行数:30,代码来源:WinningScreen.cs

示例2: AddEntries

        private void AddEntries(Difficulty difficultyLevel)
        {
            int counter = 0;

            HighScoresTextBox.Text = "                 High Scores - " + difficultyLevel.ToString();
            HighScoresTextBox.Text += "\r\n";
            HighScoresTextBox.Text += "\r\n   #       Date & Time         Duration        Score";
            HighScoresTextBox.Text += "\r\n   ---------------------------------------------";

            if (m_highScores.ContainsKey(difficultyLevel))
            {
                List<HighScoreEntry> scoreEntries = m_highScores[difficultyLevel];

                scoreEntries.Sort(CompareHighScores);

                foreach (HighScoreEntry highScore in scoreEntries)
                {
                    counter++;
                    HighScoresTextBox.Text += string.Format("\r\n  {0,2}   {1}   {2}     {3,10}",
                                                            counter,
                                                            highScore.GameTime.ToString("dd-MMM-yyyy HH:mm"),
                                                            SiriusSudokuForm.GetTimeText(highScore.DurationSeconds),
                                                            highScore.FinalScore.ToString());
                }
            }

            for (; counter < 11; counter++)
            {
                HighScoresTextBox.Text += string.Format("\r\n  {0,2}", counter);
            }
        }
开发者ID:SiriusCyberneticsCorporation,项目名称:SiriusSudoku,代码行数:31,代码来源:HighScoresForm.cs

示例3: DifficultySelected

 /// <summary>
 /// Event Listener wenn die Schwierigkeit ausgewählt wurde
 /// </summary>
 /// <param name="difficulty">ausgewählter Schwierigkeitsgrad</param>
 public void DifficultySelected(Difficulty difficulty)
 {
     this.difficulty = difficulty;
     log.Debug("Schwierigkeitsgrad ausgewaehlt: " + difficulty.ToString());
 }
开发者ID:slandgrebe,项目名称:Projektarbeit,代码行数:9,代码来源:Run.cs

示例4: StartGame

        /// <summary>
        /// Initialise the game. Start a new game with the specified difficulty, level and start score.
        /// </summary>
        /// <param name="levelDifficulty">The difficulty to play.</param>
        /// <param name="levelToPlay">The level to play.</param>
        /// <param name="startScore">Optional. Starting score.</param>
        public void StartGame(Difficulty levelDifficulty, Level levelToPlay, int startScore = 0)
        {
            // Save information.
            LevelDetails levelSettings;
            mCurrentDiff = levelDifficulty;

            if (levelToPlay == Level.All)
            {
                mCurrentLevel = Level.Deca;
                mSingleLevelGame = false;
            }
            else
            {
                mCurrentLevel = levelToPlay;
                if(startScore == 0)
                    mSingleLevelGame = true;
            }

            switch (mCurrentDiff)
            {
                case Difficulty.Easy:
                    levelSettings = LevelInformation.Easy(mCurrentLevel);
                    break;
                case Difficulty.Normal:
                    levelSettings = LevelInformation.Normal(mCurrentLevel);
                    break;
                case Difficulty.Hard:
                    levelSettings = LevelInformation.Hard(mCurrentLevel);
                    break;
                default:
                    return;
            }

            // Set information text.
            mChalkText = "Difficulty: " + mCurrentDiff.ToString() + "\nLevel: " + mCurrentLevel.ToString();

            // Initialise game objects.
            Ball.Initialise(levelSettings.NumColours, levelSettings.BallSize);
            mBoard = new Board(mBounds, startScore);

            for (int i = 0; i < levelSettings.NumRowsStart; ++i)
            {
                mBoard.AddRowTop();
            }

            mAim = new Aim(ref mBoard);

            Core.IsMouseVisible = false;
        }
开发者ID:KimRestad,项目名称:Bubbles,代码行数:55,代码来源:GameScreen.cs

示例5: Init

 public void Init(int number, int score, Difficulty difficulty)
 {
     NumberLabel.text = number + ".";
     ScoreLabel.text = System.String.Format ("{0:D8}", score);
     DifficultyLabel.text = difficulty.ToString ();
 }
开发者ID:MasatomoSegawa,项目名称:SuiteMassShipura,代码行数:6,代码来源:RankingObject.cs

示例6: SetDifficulty

 private async void SetDifficulty(Difficulty d)
 {
     await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.High, () =>
         {
             difficultyTextBlock.Text = d.ToString();
         });
 }
开发者ID:ASzot,项目名称:Sudoku-Complete,代码行数:7,代码来源:GamePage.xaml.cs

示例7: GetDifficultyImageUrl

 public static string GetDifficultyImageUrl(Difficulty difficulty, AssetSize assetSize)
 {
     var path = String.Format("campaign_progress/{0}_{1}.png", difficulty.ToString().ToLowerInvariant(), assetSize.ToString().ToLowerInvariant());
     return String.Format(Manager.ApiAssetUrl, path);
 }
开发者ID:tamilselvamr,项目名称:branch,代码行数:5,代码来源:AssetUrlHelpers.cs


注:本文中的Difficulty.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。