Skip to content
This repository has been archived by the owner on Apr 14, 2024. It is now read-only.

Commit

Permalink
Custom game boundaries, HUD adjustments,
Browse files Browse the repository at this point in the history
Fixes #28
Fixes #27
  • Loading branch information
vilbeyli committed Apr 19, 2015
1 parent 590d65e commit ae8a049
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 18 deletions.
Binary file modified Assets/Scenes/game.unity
Binary file not shown.
20 changes: 4 additions & 16 deletions Assets/Scripts/GameManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public void GameOver(bool win)

public void UpdateFlagCounter(bool condition)
{
_flagCount += condition ? 1 : -1;
_flagCount += condition ? -1 : 1;
} // true: increment | false: decrement

private void ResetGameState()
Expand Down Expand Up @@ -172,6 +172,7 @@ void CreateDummyScores()

void LoadScoresToUI()
{
// TODO: IF condition would be useful not to make too many attempts on db
// get UI Text objects
Text beginnerScores, intermediateScores, expertScores;

Expand Down Expand Up @@ -205,7 +206,7 @@ void LoadScoresToUI()

string HighScoreFormat(int i, Score score)
{
return "\t" + (i + 1) + "\t\t" + score.Name + "\t\t" + score.TimePassed + "\n\n";
return "\t" + (i + 1) + "\t\t" + score.Name + "\t\t\t" + score.TimePassed + "\n\n";
}

public void Detonate(Tile tile)
Expand All @@ -216,19 +217,6 @@ public void Detonate(Tile tile)
}
}

// SERIALIZE FIELD ???? DOESNT WORK???
[System.Serializable]
public class TileOptions
{
[SerializeField]
public int a;
[SerializeField]
public float b = 0.5f;
[SerializeField]
public bool c = false;
};
// ????????????????????????????????????

[System.Serializable]
public class GameSettings
{
Expand Down Expand Up @@ -286,7 +274,7 @@ public bool isValid()
(
( _width <= 0 || _height <= 0 || _mines <= 0 ) ||
( _mines >= _width*_height ) ||
( false )
( _height > 24 || _width > 35 )
)

return false;
Expand Down
6 changes: 4 additions & 2 deletions Assets/Scripts/UIManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,14 @@ public void UpdateFlagText(int flagCount)
flagCount = Mathf.Abs(flagCount); // ignore sign
if (Mathf.Abs(flagCount) < 10)
{
flagCountText += "00" + flagCount;
flagCountText += "00";
}
else if (Mathf.Abs(flagCount) < 100)
{
flagCountText += "0" + flagCount;
flagCountText += "0";
}
flagCountText += flagCount;


// add the constructed flag count text to the UI Text
_elements.FlagText.text += flagCountText;
Expand Down

0 comments on commit ae8a049

Please sign in to comment.