How do I "Facebook Top 10 Scores"

0 favourites
  • 9 posts
From the Asset Store
80 pieces of loopable game music, 10 game overs and 10 level complete pieces.
  • Hello friends

    I want to implement the game FLAPPING BIRD, so that you can play with Facebook (that I want to apply to a future game).

    Achieve Logging publish Score and publish on the wall.

    What we can do is to display the "Leader Board".

    Like what I do?

    Also I want to finish the game displays a list of the top 10 scores somethings, each with its name.

    The idea is to have a contest and to be aware of who is having the No. 1 spot.

    I searched for tutorials but I have not given anything.

    Can you help me please, as I see that there is no information.

    This is the link of the game

    puzzlenegro.cl/PZNGAME

    -----------------------------------------

    Hola amigos

    Quiero implementar el juego FLAPPING BIRD, para que se pueda jugar con Facebook (esto lo quiero aplicar a un futuro juego).

    Logre el Logging, publicar Score y publicar en el muro.

    Lo que no puedo hacer es lograr visualizar el “Leader Board”.

    Como lo debo hacer?

    Quisiera también que al finalizar el juego se muestre una lista con los 10 puntajes más algos, cada uno con su nombre.

    La idea es hacer un concurso y poder estar al tanto de quien es el que tiene el puesto número 1.

    He buscado tutoriales pero no he dado con nada.

    Me pueden ayudar por favor, ya que veo que no existe información al respecto.

    Este es el Link del juego

    puzzlenegro.cl/PZNGAME

  • Hi isasaurio,

    I'm also looking for the same solution.

    You can use: "Request hi-score board", from Facebook object. When you use this, you can also specify the number of top scores you want. So if you set the number to 10, we should get the top 10 scores. Please note: This will work only if user has given the "publish scores" permission.

    This much, I could understand from the Manual. But I don't know how to display the Array response from Facebook.

    I'll crack this today and let you know if I am successful.

    Please note: There are some major changes to permissions from Facebook. This happened with new version release on 30th April 2014. It'll be helpful to review them.

    Cheers,

    Capper

  • Hi,

    I have got a working solution. This will work only for leaderboard among friends. It will not show a world-wide leaderboard. This is because, if the call for scores is initiated from user, Fb will give only the user's friend's scores.

    I think clay.io plugin should help if you want world wide leaderboard. Please check this tutorial if it helps:

    https://www.scirra.com/tutorials/495/how-to-make-a-custom-leaderboard-and-more-using-clay

    I haven't used clay.io, but, I store every user's score on my server and display the world leaders on a separate page.

    Attached screenshot of events sheet.

    Logic:

    Create arrays to store High score data (I have used 2 arrays - one for name and one for score)

    Create global variable for Array indexing. ('i" in my example)

    1. Call "Request hi-score board"

    2. Set the number of scores you need - 10 in my example

    3. Use "On hi-score" to populate the arrays. Note that "On hi-score" is triggered once for each score record received. Hence if you ask 10 scores it will be triggered 10 times. For each trigger we are incrementing the index (i) and storing the data in the respective arrays.

    4. After that we display the scoreboard in different text boxes. I used 20 of them.

    IMPORTANT CHANGES TO BE MADE TO c2runtime.js

    1. In FB.init add "Version": "v2.0",

    2. js.src link change all.js --> sdk.js

    3. RequestHiscores function def add '/v2.0/' after FB.api(

    4. You have to update "channel.html" with point 2

    These are for changes due to Facebook platform upgrade.

    I have attached screenshots to illustrate all these points.

    Possible improvements:

    I think one array could be used... maybe

    2. all the fb related changes may not be necessary

    Food for thought....

    If you have less than 10 friends who have played, then "On hi-scores" will be triggered exactly for the number of players only. It will not trigger all the times. So the array will be filled partially. (to be explored: What if we have more than 10 friends and we want to dynamically display the exact number of friends who play the game???)

    Let me know if this helped.

    I'll be glad, if some experts can offer tips on optimizing what i've done.

    Cheers,

    Capper

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hi,

    I have got a working solution. This will work only for leaderboard among friends. It will not show a world-wide leaderboard. This is because, if the call for scores is initiated from user, Fb will give only the user's friend's scores.

    I think clay.io plugin should help if you want world wide leaderboard. Please check this tutorial if it helps:

    https://www.scirra.com/tutorials/495/how-to-make-a-custom-leaderboard-and-more-using-clay

    I haven't used clay.io, but, I store every user's score on my server and display the world leaders on a separate page.

    Attached screenshot of events sheet.

    Logic:

    Create arrays to store High score data (I have used 2 arrays - one for name and one for score)

    Create global variable for Array indexing. ('i" in my example)

    1. Call "Request hi-score board"

    2. Set the number of scores you need - 10 in my example

    3. Use "On hi-score" to populate the arrays. Note that "On hi-score" is triggered once for each score record received. Hence if you ask 10 scores it will be triggered 10 times. For each trigger we are incrementing the index (i) and storing the data in the respective arrays.

    4. After that we display the scoreboard in different text boxes. I used 20 of them.

    IMPORTANT CHANGES TO BE MADE TO c2runtime.js

    1. In FB.init add "Version": "v2.0",

    2. js.src link change all.js --> sdk.js

    3. RequestHiscores function def add '/v2.0/' after FB.api(

    4. You have to update "channel.html" with point 2

    These are for changes due to Facebook platform upgrade.

    I have attached screenshots to illustrate all these points.

    Possible improvements:

    I think one array could be used... maybe

    2. all the fb related changes may not be necessary

    Food for thought....

    If you have less than 10 friends who have played, then "On hi-scores" will be triggered exactly for the number of players only. It will not trigger all the times. So the array will be filled partially. (to be explored: What if we have more than 10 friends and we want to dynamically display the exact number of friends who play the game???)

    Let me know if this helped.

    I'll be glad, if some experts can offer tips on optimizing what i've done.

    Cheers,

    Capper

    Thank you very much friend, I will put into practice and tell you how it goes.

    Thank you

  • I exported my game to Windows 8, but when I try to use the Facebook object it says:

    Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed

    Do you know how to fix this?

  • you need to set as the "FROM FACEBOOK" as a "APPLICATION FOR WINDOWS".

  • Yes, I have done it, I also set the Windows Store ID on the Facebook App, I still get that error

  • vishymuku can you provide .capx file? thanks

  • isasaurio have you done with fb plug in . could you please let me know where i can get IMPORTANT CHANGES TO BE MADE TO c2runtime.js

    1. In FB.init add "Version": "v2.0",

    2. js.src link change all.js --> sdk.js

    3. RequestHiscores function def add '/v2.0/' after FB.api(

    4. You have to update "channel.html" with point 2

    above file to edit?

    thanks

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)