diff --git a/games/tetris/README.md b/games/tetris/README.md index 2201b89f..73096e6d 100644 --- a/games/tetris/README.md +++ b/games/tetris/README.md @@ -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 | diff --git a/games/tetris/lang/fr.txt b/games/tetris/lang/fr.txt index 4a10cedd..fe1328ae 100644 --- a/games/tetris/lang/fr.txt +++ b/games/tetris/lang/fr.txt @@ -6,7 +6,7 @@ BEST RECORD SCORE SCORE LEVEL NIVEAU LINES LIGNES -\n HOW TO PLAY\n\n - and to move\n - for soft drop\n - for hard drop\n - & to rotate left and right\n - () to hold the tetri\n - 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 - et : déplacer\n - : descente rapide\n - : chute directe\n - et : tourner\n - () : réserver\n - : 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 - and to move\n - for soft drop\n - to rotate left and right\n - & for hard drop\n - () to hold the tetri\n - 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 - et : déplacer\n - : descente rapide\n - : chute directe\n - et : tourner\n - () : réserver\n - : 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 diff --git a/games/tetris/lang/zh.txt b/games/tetris/lang/zh.txt index 9982924c..76f9643a 100644 --- a/games/tetris/lang/zh.txt +++ b/games/tetris/lang/zh.txt @@ -7,7 +7,7 @@ BEST 最高分 SCORE 得分 LEVEL 等级 LINES 行数 -\n HOW TO PLAY\n\n - and to move\n - for soft drop\n - for hard drop\n - & to rotate left and right\n - () to hold the tetri\n - 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 - /<工具箱>:向左/向右旋转\n - <退格>():暂存方块\n - <返回>:暂停\n\n 填满一行即可消除,\n 一次消除多行得分更高!\n 每消除 10 行升一级。\n 方块堆到顶部即失败。\n 暂存的方块可留待以后使用! +\n HOW TO PLAY\n\n - and to move\n - for soft drop\n - to rotate left and right \n - & for hard drop\n - () to hold the tetri\n - 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 - /<工具箱>:向左/向右旋转\n - <退格>():暂存方块\n - <返回>:暂停\n\n 填满一行即可消除,\n 一次消除多行得分更高!\n 每消除 10 行升一级。\n 方块堆到顶部即失败。\n 暂存的方块可留待以后使用! Ghost Piece 显示落点 Yes 是 No 否 diff --git a/games/tetris/tetris/src/game_tetris.rs b/games/tetris/tetris/src/game_tetris.rs index 0b38bf12..f5f9b89c 100644 --- a/games/tetris/tetris/src/game_tetris.rs +++ b/games/tetris/tetris/src/game_tetris.rs @@ -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 - and to move\n - for soft drop\n - for hard drop\n - & to rotate left and right\n - () to hold the tetri\n - 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 - and to move\n - for soft drop\n - to rotate left and right\n - & for hard drop\n - () to hold the tetri\n - 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] = [ @@ -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 { @@ -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, }; diff --git a/tests/test_games.py b/tests/test_games.py index 0e5b4d65..3dd71785 100644 --- a/tests/test_games.py +++ b/tests/test_games.py @@ -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"),