从排行榜获取分数和玩家信息
我希望能够显示我的游戏中各个级别的前十名左右的分数列表。我查看了一下,发现 openfeint 有一个回调方法,
Leaderboard.getScores(Leaderboard.GetScoresCB cb)
我不确定如何实现这个方法,所以我尝试
public static void getScores(){
Leaderboard l = new Leaderboard(getRightLB(level, section));
float score = l.getScores(Leaderboard.GetScoresCB cb)
}
在该方法的第二行出现错误的构造错误。 android 版本的佯攻的实现似乎很差,有谁知道实现这个的正确方法。
另外,是否还可以获取用户名和个人资料图片以及分数数据?
I want to be able to show a list of the top ten or so scores for the levels in my game. I looked and I found that openfeint had a callback method for this
Leaderboard.getScores(Leaderboard.GetScoresCB cb)
I was not sure how to implement this so I tried
public static void getScores(){
Leaderboard l = new Leaderboard(getRightLB(level, section));
float score = l.getScores(Leaderboard.GetScoresCB cb)
}
I got a misplaced constructs error on the second line of the method.
Implementation for the android version of feint seems pretty poor, does anyone know the correct way to implement this.
Also is it possible to also get user names and profile pics along with the score data?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
回答
就像提交乐谱一样进行设置,呵呵!
编辑:我已经解决了用户名/个人资料图片的问题。
事实证明,Score 对象与其他信息以及分数的数值捆绑在一起。
获取数值分值:
对应的用户名:
以及头像的url:
Answer
Set it up just like you were submitting a score, Duh!
EDIT: I've worked out the user name/profile picture thing.
Turns out that the Score object comes bundled with other information as well as just the numerical value of the score.
To get the numerical score value:
The corresponding username:
And the url of the profile picture: