So in my game there is score tab that will show in gameover
This is example for my tab score
This is the code :
highscoretext = (TextView)findViewById(R.id.bt);
highscoretext.setText("0");
currentscore = (TextView)findViewById(R.id.ct);
currentscore.setText(String.valueOf(gamescore));
And this is how i save the score that will display in bestscore
SharedPreferences pref = getSharedPreferences("SavedGame", MODE_PRIVATE);
SharedPreferences.Editor editor = pref.edit();
editor.putInt("totalScore", gamescore);
if (gamescore > highscore){
highscoretext.setText(String.valueOf(gamescore));
editor.putInt("highscore", gamescore);
editor.commit();
And i wonder to make an animation to my TextView
like this
So when the tab score display, the score will count from 0 to Current score that get in the game, example : 10
and when score stop count, if the score > best score, the value in best score changed
Can anyone help me?