14.06.2011

All about scores

posted by Karsten

/* ALL ABOUT SCORES */ //Send a score to the View to view //Would it be better to do this inside this thread writing it manually on the screen? public void setScore(long score) { this.score = score; synchronized (mSurfaceHolder) { Message msg = mHandler.obtainMessage(); Bundle b = new Bundle(); b.putBoolean("score", true); b.putString("text", getScoreString().toString()); msg.setData(b); mHandler.sendMessage(msg); } } public float getScore() { return score; } public void updateScore(long score) { this.setScore(this.score + score); } protected CharSequence getScoreString() { return Long.toString(Math.round(this.score)); }

Share

Place your comment

Please fill your data and comment below.
Name
Email
Website
Your comment