Jump to content

I want to make a leader board


Recommended Posts

I made an endless runner game using panda2 and it is working perfectly , now i want to add a leaderboard but when i searched in panda2  documentation i did not know how can i make it , can anyone help me please ?!

Link to comment
Share on other sites

Hello , Are you planning to add online leaderboaror offline leaderboard???

about offline

You can try  localStorage to save the score.




about online, you need to use server side programming languages

if your game export to mobile device, you can integration Google play services


hope can help

Link to comment
Share on other sites

15 hours ago, Hosh said:

but how can i also make a text field and take player name ??

For example, like this: https://plnkr.co/edit/CJ9iGJr4mkysO5t0?preview

<!doctype html>

        <input id="nameField" value="Enter your name...">
        <button id="okButton" onclick="okButton_OnClick()">Ok</button>

          function okButton_OnClick() {
              var nameField = document.getElementById("nameField");
              var name = nameField.value;


Edited by 8Observer8
Link to comment
Share on other sites


Try this example, simple way to make player input his name


Keyboard: input you name

Enter: Enter your name  (only input number and alphabet )

.body(function() {

game.createScene('Main', {
    init: function() {     
        this.Name = [];
        this.InputField = new game.SystemText('Enter Name:');
        this.InputField.size = 30;
        this.YourName = new game.SystemText('');
        this.YourName.position.y = 50;
        this.YourName.size = 30;
        this.YourName.color = 'yellow';
    keydown: function(key) {
      if(key === "BACKSPACE" || key === "DELETE"){
      }else if(key === "ENTER"){
      this.YourName.text = "Your Name: " + this.Name.join("");  
      else if(window.event.keyCode > 48 && window.event.keyCode <90){   
      this.InputField.text = this.Name.join("");



Hope can help

Edited by khleug35
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...