Language/Multiple-languages/Culture/How-to-Customise-Open–Source-Language-Games

From Polyglot Club WIKI
< Language‎ | Multiple-languages‎ | Culture
Revision as of 11:40, 11 April 2022 by GrimPixel (talk | contribs) (Created page with "This is an introduction to the customisation of open-source language games for non-programmers. Use 'search in page' to find the lines quickly. In the description, 'fit' mean...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Rate this lesson:
5.00
(one vote)

This is an introduction to the customisation of open-source language games for non-programmers. Use 'search in page' to find the lines quickly.

In the description, 'fit' means finding and duplicating the existing code and modify it to fit your new language.

For JavaScript games, they are usually opened with index.html.

In progress.

Scrabble

https://github.com/edlerd/scrabble

change the word list

  • /dict/

Change the lists.

change the letter frequency and value

    • /config/english.jsonp
    • /config/german.jsonp
    • /multiplayer/game/config/english.jsonp
    • /multiplayer/game/config/german.jsonp

Change the frequency by repeatance of letter in LETTER_STASH; change the value by changing values in POINTS_PER_LETTER.

add a language

  • /config/
    1. add a language with word list
  • /index.html
    1. fit
      class="language_selector"
    • /game.js
    • /multiplayer/game/game.js
    1. fit
      LANGUAGE_CONFIG;
    2. fit
      LANG_ENGLISH
    3. fit
      function getConfigUrl()
  • /multiplayer/config.php
    1. fit
      'language/English.php'
  • /multiplayer/0_register.php
    1. find
      player->language = in_array;
      , add the language in
      [ LANGUAGE_ENGLISH, LANGUAGE_GERMAN ]
    2. fit
      LANGUAGE_ENGLISH, LANGUAGE_GERMAN
  • /multiplayer/1_matchmaker.php
    1. find
      game->stashLetters
      , replace the line with
$game->stashLetters = array_values(switch($player->language){"english":English::LETTER_STASH; break;"german":German::LETTER_STASH; break;}
    1. fit it

Contributors

GrimPixel, Maintenance script and Vincent


Create a new Lesson