Skip to content

Commit e4a3858

Browse files
committed
adding soft clamp to score
1 parent 9b086dc commit e4a3858

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Data/DataController.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ public int Score {
2828
return GetInt(DATA_SCORE);
2929
}
3030
set {
31+
// soft clamp value at 0
32+
if (value < 0) {
33+
value = 0;
34+
}
35+
3136
SaveInt(DATA_SCORE, value);
3237
int _score = this.Score;
3338
if (_score > this.Highscore) {

0 commit comments

Comments
 (0)