How do I attach a name to a high score?

  • How do I:

    1. Attach a string of letters to a high score

    2. Limit the characters my players can use on said string

    And I also would like to know how do I implement letting my players type their letters through their digital keyboards in their mobile devices.

    Any help would be greatly appreciated.

  • anybody?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hey Importuno!

    You just have to save two values instead of one. As I understand you already save the scores to a high score table (by whatever method you use), so, instead, you'd save two values, the scores and player names.

    If you use a one-dimensional array to save the highscores (like highscores = [100000, 80000, 60000, 40000, 20000]), you should now use a two-dimensional array (like highscores = [[100000, "IMP"], [80000, "BP"], [60000, "DOP"], [40000, "ASH"], [20000, "NWB"]]).

    Regarding the limitation of length, you could use a TextBox object, which already alows players to type using their mobile phone's native keyboard, and limit its length by using a "On text changed" event like below:

    [TextBox  |  On text changed] [Set text to left(TextBox.Text, 3)]
    [/code:1mzstzzq]
    
    In this case I'm limiting the length to 3.
    
    Hope this helps. Cheers!
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)