Difference between revisions of "Language/Multiple-languages/Culture/How-to-Customise-Open–Source-Language-Games"
< Language | Multiple-languages | Culture
Jump to navigation
Jump to search
Line 35: | Line 35: | ||
*# fit <pre>'language/English.php'</pre> | *# fit <pre>'language/English.php'</pre> | ||
* /multiplayer/0_register.php | * /multiplayer/0_register.php | ||
*# fit <pre>const LANGUAGE_ENGLISH = 'english';</pre> | |||
*# find <pre>player->language = in_array;</pre>, add the language in <pre>[ LANGUAGE_ENGLISH, LANGUAGE_GERMAN ]</pre> | *# find <pre>player->language = in_array;</pre>, add the language in <pre>[ LANGUAGE_ENGLISH, LANGUAGE_GERMAN ]</pre> | ||
* /multiplayer/1_matchmaker.php | * /multiplayer/1_matchmaker.php | ||
*# 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 |
Revision as of 11:53, 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.
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/
- add a language with word list
- /index.html
- fit
<div class="language_selector">
- fit
-
- /game.js
- /multiplayer/game/game.js
- fit
const LANG_ENGLISH = 'english';
- fit
const ENGLISH_CONFIG_URL = 'config/english.jsonp';
- fit
function getConfigUrl()
- /multiplayer/config.php
- fit
'language/English.php'
- fit
- /multiplayer/0_register.php
- fit
const LANGUAGE_ENGLISH = 'english';
- find
player->language = in_array;
, add the language in[ LANGUAGE_ENGLISH, LANGUAGE_GERMAN ]
- fit
- /multiplayer/1_matchmaker.php
- find
$game->stashLetters
, replace the line with$game->stashLetters = array_values(switch($player->language){"english":English::LETTER_STASH; break;"german":German::LETTER_STASH; break;}
- fit the line
- find