Game Development Reference
In-Depth Information
{
OF.LaunchLeaderboardDashboard("796236");
}
if (GUI.Button(new Rect(10,130,150,50),
"Achievements"))
{
OF.LaunchAchievements();
}
if (GUI.Button(new Rect(10,190,150,50),
"Get Scores"))
{
OF.GetHighScores ("796236");
}
if (GUI.Button(new Rect(10,250,150,50),
"Submit Score"))
{
OF.SubmitScore("796236",score);
}
}
}
function Update ()
{
if(Mathf.Abs(Input.acceleration.x) > 1 ||
Mathf.Abs(Input.acceleration.y) > 1 ||
Mathf.Abs(Input.acceleration.z) > 1)
{
iPhoneUtils.Vibrate();
score++;
if(score > 400 && !medal)
{
OF.UnlockAchievement(1052482);
OF.Message("You've achieved a Gold Medal!");
medal = true;
}
}
}
Step 21. Build and Run. Screen displays are shown in Figure 8.28 .
When the application first opens it will display a score and
Initialize OpenFeint button ( Figure 8.28a ). On pressing this, the
OpenFeint linkage will log you in ( Figure 8.28b ). When logged in
this button will disappear and the other buttons will be displayed
( Figure 8.28c ).
Search Nedrilad ::




Custom Search