Hosh Posted May 19, 2020 Share Posted May 19, 2020 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 ?! Quote Link to comment Share on other sites More sharing options...
khleug35 Posted May 19, 2020 Share Posted May 19, 2020 Hello , Are you planning to add online leaderboard or offline leaderboard??? about offline You can try localStorage to save the score. https://www.panda2.io/docs/api/Storage https://www.panda2.io/examples#storage-get 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 Hosh 1 Quote Link to comment Share on other sites More sharing options...
Hosh Posted May 20, 2020 Author Share Posted May 20, 2020 thank you , yes it will help but how can i also make a text field and take player name ?? Quote Link to comment Share on other sites More sharing options...
8Observer8 Posted May 20, 2020 Share Posted May 20, 2020 (edited) 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> <html> <body> <input id="nameField" value="Enter your name..."> <button id="okButton" onclick="okButton_OnClick()">Ok</button> <script> function okButton_OnClick() { var nameField = document.getElementById("nameField"); var name = nameField.value; console.log(name); } </script> </body> </html> Edited May 20, 2020 by 8Observer8 Hosh 1 Quote Link to comment Share on other sites More sharing options...
tkohey_sad Posted May 21, 2020 Share Posted May 21, 2020 (edited) 19 hours ago, Hosh said: but how can i also make a text field and take player name ?? Check this: https://github.com/goldfire/CanvasInput Edited May 21, 2020 by tkohey_sad Quote Link to comment Share on other sites More sharing options...
Hosh Posted May 21, 2020 Author Share Posted May 21, 2020 i tried everything to make inputfield in panda 2 engine but it does not work Quote Link to comment Share on other sites More sharing options...
makowey Posted May 27, 2020 Share Posted May 27, 2020 https://www.panda2.io/games/woriar has the "Enter name" functionality in place. Quote Link to comment Share on other sites More sharing options...
khleug35 Posted May 27, 2020 Share Posted May 27, 2020 (edited) @Hosh Try this example, simple way to make player input his name Control: Keyboard: input you name Enter: Enter your name (only input number and alphabet ) game.module( 'game.main' ) .body(function() { game.createScene('Main', { init: function() { this.Name = []; this.InputField = new game.SystemText('Enter Name:'); this.InputField.size = 30; this.InputField.addTo(this.stage); this.YourName = new game.SystemText(''); this.YourName.position.y = 50; this.YourName.size = 30; this.YourName.color = 'yellow'; this.YourName.addTo(this.stage); }, keydown: function(key) { if(key === "BACKSPACE" || key === "DELETE"){ this.Name.pop(); }else if(key === "ENTER"){ this.YourName.text = "Your Name: " + this.Name.join(""); } else if(window.event.keyCode > 48 && window.event.keyCode <90){ this.Name.push(key); } this.InputField.text = this.Name.join(""); } }); }); Hope can help Edited May 28, 2020 by khleug35 Quote Link to comment Share on other sites More sharing options...
Hosh Posted May 30, 2020 Author Share Posted May 30, 2020 @khleug35 thanks that was very useful for me Quote Link to comment Share on other sites More sharing options...
Hosh Posted June 2, 2020 Author Share Posted June 2, 2020 @khleug35 is that input filed supported for smart phone (touch keyboard) or not ?? Quote Link to comment Share on other sites More sharing options...
khleug35 Posted June 5, 2020 Share Posted June 5, 2020 hi Sorry to say not....... only for real keyboard Quote Link to comment Share on other sites More sharing options...
Hosh Posted June 7, 2020 Author Share Posted June 7, 2020 @khleug35 is there away to make input filed for mobile or not ?? Quote Link to comment Share on other sites More sharing options...
khleug35 Posted June 9, 2020 Share Posted June 9, 2020 On 6/7/2020 at 6:02 PM, Hosh said: @khleug35 is there away to make input filed for mobile or not ?? one of my way create a virtual on-screen keyboard(button) like this game http://mindfrog.ffx.it/ Hosh 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.