本文整理汇总了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));
}
示例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);
}
}
示例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());
}
示例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;
}
示例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 ();
}
示例6: SetDifficulty
private async void SetDifficulty(Difficulty d)
{
await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.High, () =>
{
difficultyTextBlock.Text = d.ToString();
});
}
示例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);
}