Difference between revisions of "Language/Multiple-languages/Culture/How-to-Customise-Open–Source-Language-Games"

From Polyglot Club WIKI
Jump to navigation Jump to search
Line 4: Line 4:


Some games support multiplayer online, but if you are new to programming, you don't need to consider that.
Some games support multiplayer online, but if you are new to programming, you don't need to consider that.
For JavaScript games, they are usually opened with index.html.


In progress.
In progress.
Line 11: Line 9:
== Scrabble ==
== Scrabble ==
=== https://github.com/edlerd/scrabble ===
=== https://github.com/edlerd/scrabble ===
Played with index.html.
<big>'''change the word list'''</big>
<big>'''change the word list'''</big>
* /dict/
* /dict/
Line 52: Line 52:
*# find <pre>$game->stashLetters</pre>, replace the line with <pre>$game->stashLetters = array_values(switch($player->language){"english":English::LETTER_STASH; break;"german":German::LETTER_STASH; break;}</pre>
*# find <pre>$game->stashLetters</pre>, replace the line with <pre>$game->stashLetters = array_values(switch($player->language){"english":English::LETTER_STASH; break;"german":German::LETTER_STASH; break;}</pre>
*# fit the line
*# fit the line
== Spelling Bee ==
=== https://github.com/rsuth/bumblewords ===
Played with /views/index.pug
<big>'''change the word list'''</big>
* /dictionary.txt
Change the list.

Revision as of 12:06, 11 April 2022

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 corresponding code and modify it to fit your new language according to the pattern.

Some games support multiplayer online, but if you are new to programming, you don't need to consider that.

In progress.

Scrabble

https://github.com/edlerd/scrabble

Played with index.html.

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 in singleplayer

  • /config/
    1. add a language with word list
  • /index.html
    1. fit
      <div class="language_selector">
  • /game.js
    1. fit
      const LANG_ENGLISH = 'english';
    2. fit
      const ENGLISH_CONFIG_URL = 'config/english.jsonp';
    3. fit
      function getConfigUrl()

add a language in singleplayer and multiplayer

  • /config/
    1. add a language with word list
  • /index.html
    1. fit
      <div class="language_selector">
    • /game.js
    • /multiplayer/game/game.js
    1. fit
      const LANG_ENGLISH = 'english';
    2. fit
      const ENGLISH_CONFIG_URL = 'config/english.jsonp';
    3. fit
      function getConfigUrl()
  • /multiplayer/config.php
    1. fit
      'language/English.php'
  • /multiplayer/0_register.php
    1. fit
      const LANGUAGE_ENGLISH = 'english';
    2. find
      player->language = in_array;
      , add the language in
      [ 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;}
    2. fit the line

Spelling Bee

https://github.com/rsuth/bumblewords

Played with /views/index.pug

change the word list

  • /dictionary.txt

Change the list.