Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions games/tetris/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ The original is released into the public domain ([UNLICENSE](UNLICENSE)). This c
| --- | --- |
| Left / Right, or 4 / 6 | Move |
| Down, or 2 | Soft drop |
| Up, or 8 | Hard drop |
| OK / Toolbox | Rotate left / right |
| Up, or 8 | Rotate left / right |
| OK / Toolbox | Hard drop |
| ⌫ | Hold |
| Back | Pause, with Quit game |

Expand Down
2 changes: 1 addition & 1 deletion games/tetris/lang/fr.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ BEST RECORD
SCORE SCORE
LEVEL NIVEAU
LINES LIGNES
\n HOW TO PLAY\n\n - <LEFT> and <RIGHT> to move\n - <DOWN> for soft drop\n - <UP> for hard drop\n - <OK> & <TOOLBOX> to rotate left and right\n - <BACKSPACE> (<clear>) to hold the tetri\n - <BACK> to pause\n\n Every full line disappears\n Get more points by clearing\n multiple lines at once !\n The level increases every 10 lines.\n You lose when the stack reaches the top. \n Hold the tetri to keep it for later ! \n COMMENT JOUER\n\n - <GAUCHE> et <DROITE> : déplacer\n - <BAS> : descente rapide\n - <HAUT> : chute directe\n - <OK> et <BOÎTE À OUTILS> : tourner\n - <EFFACER> (<clear>) : réserver\n - <RETOUR> : pause\n\n Une ligne pleine disparaît.\n Plus de points en effaçant\n plusieurs lignes d'un coup !\n Le niveau monte toutes les 10 lignes.\n Perdu si la pile atteint le haut.\n Réserve une pièce pour plus tard !
\n HOW TO PLAY\n\n - <LEFT> and <RIGHT> to move\n - <DOWN> for soft drop\n - <UP> to rotate left and right\n - <OK> & <TOOLBOX> for hard drop\n - <BACKSPACE> (<clear>) to hold the tetri\n - <BACK> to pause\n\n Every full line disappears\n Get more points by clearing\n multiple lines at once !\n The level increases every 10 lines.\n You lose when the stack reaches the top. \n Hold the tetri to keep it for later ! \n COMMENT JOUER\n\n - <GAUCHE> et <DROITE> : déplacer\n - <BAS> : descente rapide\n - <HAUT> : chute directe\n - <OK> et <BOÎTE À OUTILS> : tourner\n - <EFFACER> (<clear>) : réserver\n - <RETOUR> : pause\n\n Une ligne pleine disparaît.\n Plus de points en effaçant\n plusieurs lignes d'un coup !\n Le niveau monte toutes les 10 lignes.\n Perdu si la pile atteint le haut.\n Réserve une pièce pour plus tard !
Ghost Piece Pièce fantôme
Yes Oui
No Non
Expand Down
2 changes: 1 addition & 1 deletion games/tetris/lang/zh.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ BEST 最高分
SCORE 得分
LEVEL 等级
LINES 行数
\n HOW TO PLAY\n\n - <LEFT> and <RIGHT> to move\n - <DOWN> for soft drop\n - <UP> for hard drop\n - <OK> & <TOOLBOX> to rotate left and right\n - <BACKSPACE> (<clear>) to hold the tetri\n - <BACK> to pause\n\n Every full line disappears\n Get more points by clearing\n multiple lines at once !\n The level increases every 10 lines.\n You lose when the stack reaches the top. \n Hold the tetri to keep it for later ! \n 玩法说明\n\n - 左/右方向键:左右移动\n - 下方向键:加速下落\n - 上方向键:直接落下\n - <OK>/<工具箱>:向左/向右旋转\n - <退格>(<clear>):暂存方块\n - <返回>:暂停\n\n 填满一行即可消除,\n 一次消除多行得分更高!\n 每消除 10 行升一级。\n 方块堆到顶部即失败。\n 暂存的方块可留待以后使用!
\n HOW TO PLAY\n\n - <LEFT> and <RIGHT> to move\n - <DOWN> for soft drop\n - <UP> to rotate left and right \n - <OK> & <TOOLBOX> for hard drop\n - <BACKSPACE> (<clear>) to hold the tetri\n - <BACK> to pause\n\n Every full line disappears\n Get more points by clearing\n multiple lines at once !\n The level increases every 10 lines.\n You lose when the stack reaches the top. \n Hold the tetri to keep it for later ! \n 玩法说明\n\n - 左/右方向键:左右移动\n - 下方向键:加速下落\n - 上方向键:直接落下\n - <OK>/<工具箱>:向左/向右旋转\n - <退格>(<clear>):暂存方块\n - <返回>:暂停\n\n 填满一行即可消除,\n 一次消除多行得分更高!\n 每消除 10 行升一级。\n 方块堆到顶部即失败。\n 暂存的方块可留待以后使用!
Ghost Piece 显示落点
Yes 是
No 否
Expand Down
8 changes: 4 additions & 4 deletions games/tetris/tetris/src/game_tetris.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ fn vis_addon() {
}

/// The "How to Play" page (one line per line of the screen, 45 small letters wide).
const CONTROLS: &str = T!("\n HOW TO PLAY\n\n - <LEFT> and <RIGHT> to move\n - <DOWN> for soft drop\n - <UP> for hard drop\n - <OK> & <TOOLBOX> to rotate left and right\n - <BACKSPACE> (<clear>) to hold the tetri\n - <BACK> to pause\n\n Every full line disappears\n Get more points by clearing\n multiple lines at once !\n The level increases every 10 lines.\n You lose when the stack reaches the top. \n Hold the tetri to keep it for later ! ");
const CONTROLS: &str = T!("\n HOW TO PLAY\n\n - <LEFT> and <RIGHT> to move\n - <DOWN> for soft drop\n - <UP> to rotate left and right\n - <OK> & <TOOLBOX> for hard drop\n - <BACKSPACE> (<clear>) to hold the tetri\n - <BACK> to pause\n\n Every full line disappears\n Get more points by clearing\n multiple lines at once !\n The level increases every 10 lines.\n You lose when the stack reaches the top. \n Hold the tetri to keep it for later ! ");

pub fn start() {
let mut opt: [&mut Setting; 3] = [
Expand Down Expand Up @@ -184,10 +184,10 @@ const SOFT_DROP_SPEED: u64 = 33;
const LEFT_KEY: u32 = key::LEFT;
const RIGHT_KEY: u32 = key::RIGHT;
const SOFT_DROP_KEY: u32 = key::DOWN;
const HARD_DROP_KEY: u32 = key::UP;
const HARD_DROP_KEY: u32 = key::OK;
const PAUSE_KEY: u32 = key::BACK;
const RIGHT_ROTATION_KEY: u32 = key::TOOLBOX;
const LEFT_ROTATION_KEY: u32 = key::OK;
const LEFT_ROTATION_KEY: u32 = key::UP;
const HOLD_KEY: u32 = key::BACKSPACE;

const DEATH_MENU: MenuConfig = MenuConfig {
Expand Down Expand Up @@ -278,7 +278,7 @@ pub fn game(
};
let mut blockers = Blockers {
hold: false,
hard_drop: false,
hard_drop: start_keys.key_down(HARD_DROP_KEY),
soft_drop: false,
};

Expand Down
4 changes: 2 additions & 2 deletions tests/test_games.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ def every(t0, t1, step, key, d=80):
(3500, "ok", 250)), 5500,
presses((1500, "ok", 250), (2000, "right", 250), (2500, "ok", 250), (3000, "left", 250),
(3500, "ok", 250)), 5500),
"tetris": ("Tetris.nwa", "tetris.sav", presses((1200, "ok")) + every(2500, 7000, 500, "up"), 8000,
presses((1200, "ok"), (2500, "ok")), 5000),
"tetris": ("Tetris.nwa", "tetris.sav", presses((1200, "ok")) + every(2500, 7000, 500, "ok"), 8000,
presses((1200, "ok"), (2500, "ok")), 5000),
# add-ons, the Counter (5th), count to 2; next time it opens there: one more
"numvisuals": ("NumVisuals.nwa", "numvisuals.sav",
presses((1500, "ok"), (2000, "right"), (2300, "right"), (2600, "right"), (2900, "right"),
Expand Down