{"id":15137878,"url":"https://github.com/ramirisu/tetris","last_synced_at":"2026-01-20T03:04:26.576Z","repository":{"id":255358420,"uuid":"843117253","full_name":"Ramirisu/tetris","owner":"Ramirisu","description":"Classic Tetris (NES Tetris) written in BEVY/RUST.","archived":false,"fork":false,"pushed_at":"2025-03-21T20:25:48.000Z","size":190333,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-06T06:44:22.390Z","etag":null,"topics":["bevy","nes","nes-tetris","tetris"],"latest_commit_sha":null,"homepage":"https://ramirisu.github.io/tetris/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ramirisu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-15T20:21:13.000Z","updated_at":"2025-03-26T01:07:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"e9be44eb-e73c-4d66-856f-5ee3ffcd7d1e","html_url":"https://github.com/Ramirisu/tetris","commit_stats":{"total_commits":188,"total_committers":1,"mean_commits":188.0,"dds":0.0,"last_synced_commit":"2a8996964760d7fd2f6bb948bcac5fad130e6fa3"},"previous_names":["ramirisu/tetris"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ramirisu%2Ftetris","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ramirisu%2Ftetris/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ramirisu%2Ftetris/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ramirisu%2Ftetris/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ramirisu","download_url":"https://codeload.github.com/Ramirisu/tetris/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247445652,"owners_count":20939953,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bevy","nes","nes-tetris","tetris"],"created_at":"2024-09-26T07:03:10.724Z","updated_at":"2026-01-20T03:04:26.570Z","avatar_url":"https://github.com/Ramirisu.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tetris\n\n[![Build](https://github.com/Ramirisu/tetris/actions/workflows/build.yml/badge.svg)](https://github.com/Ramirisu/tetris/actions/workflows/build.yml)\n[![dependency status](https://deps.rs/repo/github/Ramirisu/tetris/status.svg)](https://deps.rs/repo/github/Ramirisu/tetris)\n\nClassic Tetris (NES Tetris) built using the Bevy engine.\n\n## Features\n\n- Game Play\n  - [x] Game Statistics\n  - [x] Piece Distribution\n  - [x] Input Display\n  - [x] Sound Effects\n  - [x] Support English/繁體中文/简体中文\n\n- Platform\n  - [x] High FPS Support\n  - [x] Cross-platform (Web/Windows/Linux/MacOS)\n\n\u003e It's recommended to run the DESKTOP version, which is much smoother than the WEB version.\n\n## Game Options\n\n**TRANSITION**\n\nThe *TRANSITION* option determines how the level advances after clearing lines.\n\n| Options        | Description                                                                                                                                                                                          |\n| -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| Classic        | When the player clears `(startLevel × 10 + 10)` or `max(100, (startLevel × 10 - 50))` lines, whichever comes first, the level advances by 1. After this, the level advances by 1 for every 10 lines. |\n| Fixed          | When the player clears `(startLevel × 10 + 10)` lines, the level advances by 1. After this, the level advances by 1 for every 10 lines.                                                              |\n| Every 10 Lines | The level advances by 1 for every `10` lines.                                                                                                                                                        |\n| Every 4 Lines  | The level advances by 1 for every `4` lines.                                                                                                                                                         |\n\n**LINECAP**\n\nThe *LINECAP* option enables the end game mechanism for competitive matches. Players can keep going under *kill screen* due to the invention of the *rolling* technique. The end game mechanism can be used to avoid endless gameplay.\n\n| Options        | Description                                                                                                                                   |\n| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |\n| Off            | The gravity is the same as level 29 for level 39 and beyond.                                                                                  |\n| Kill Screen X2 | NTSC: The gravity becomes *200%* of level 29 starting from level 39.\u003cbr /\u003ePAL: The gravity becomes *200%* of level 19 starting from level 29. |\n| Halt           | The game ends when it reaches level 39.                                                                                                       |\n\n**LINECAP LEVEL**\n\nThe *LINECAP LEVEL* option controls the level at which the *LINECAP* feature is triggered. By default, this is level 39 for NTSC and level 29 for PAL.\n\n**GRAVITY**\n\nThe *GRAVITY* option determines how the gravity will increase when the level advances.\n\n| Options | Description                                    |\n| ------- | ---------------------------------------------- |\n| Level   | The gravity increases when the level advances. |\n| Locked  | The gravity is locked at the `startLevel`.     |\n\n**RANDOM**\n\nThe *RANDOM* option determines how to generate NEXT pieces.\n\n| Options | Description                                                                                                        |\n| ------- | ------------------------------------------------------------------------------------------------------------------ |\n| Uniform | Every piece has the same chance (1/7) to be chosen and each generation is independent.                             |\n| Classic | The algorithm 1H2R is used. The randomizer has less chance to generate the same piece as current one.              |\n| Modern  | The algorithm 7Bag is used. The randomizer always generates 7 pieces each and shuffle their order as the sequence. |\n\n**SEEDING**\n\nThe *SEEDING* option determines how to set the initial seed for the random number generator.\n\n| Options | Description                                                                                           |\n| ------- | ----------------------------------------------------------------------------------------------------- |\n| System  | System-provided seeds are used and result in different sequences for each game.                       |\n| Custom  | User-provided seed is used, generating a constant sequence. This mode is built for competitive match. |\n\n**SEED**\n\nThe *SEED* option can be used to set the given initial seed by user. It is only available when **SEEDING** is set to `CUSTOM`.\n\n- Press `Start` to enter/leave seed configuration.\n- Press `Up` and `Down` to adjust the hex value.\n- Press `Select` to generate a random seed.\n\n**SCORE DISPLAY**\n\nThe *SCORE DISPLAY* option determines how the score is displayed.\n\n| Options | Description                                                       |      123 | 1,234,567 | 3,704,567 | 39,504,567 |\n| ------- | ----------------------------------------------------------------- | -------: | --------: | --------: | ---------: |\n| Decimal | Display the score in decimal up to `2^64`.                        | `000123` | `1234567` | `3704567` | `39504567` |\n| Classic | Display the score in decimal up to `999999`.                      | `000123` |  `999999` |  `999999` |   `999999` |\n| Base36  | Apply `base36` encoding for the 6th digit and above of the score. | `000123` |  `C34567` | `1104567` |  `AZ04567` |\n\n**LEVEL DISPLAY**\n\nThe *LEVEL DISPLAY* option determines how the level is displayed.\n\n| Options | Description                                                                                                     |\n| ------- | --------------------------------------------------------------------------------------------------------------- |\n| Decimal | Levels are always displayed in decimal.                                                                         |\n| Classic | Levels above 29 will be displayed in hexadecimal. For example: level 31 will be `0A` and level 33 will be `1E`. |\n\n**TV SYSTEM**\n\nThe *TV SYSTEM* option determines which version of NES Tetris is used. This affects DAS, gravity, and the level of linecap.\n\n| Options | Description                                                                                                                                            |\n| ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| NTSC    | The NTSC version of NES Tetris, which is specified to run at 60 frames per second.                                                                     |\n| PAL     | The PAL version of NES Tetris, which is specified to run at 50 frames per second. The game is rebalanced for the slower frame rate in the PAL release. |\n\n\u003e Reference: https://tetris.wiki/Tetris_(NES,_Nintendo)\n\n**NEXT PIECE HINT**\n\nThe *NEXT PIECE HINT* option determines how many NEXT pieces are displayed.\n\n| Options | Description           |\n| ------- | --------------------- |\n| Off     |                       |\n| Classic | Show next piece only. |\n| Modern  | Show next `5` pieces. |\n\n**INVISIBLE**\n\nThe *INVISIBLE* option determines the visibility of the locked squares.\n\n| Options | Description                            |\n| ------- | -------------------------------------- |\n| Off     | All squares are visible.               |\n| On      | Squares that are locked are invisible. |\n\n## Keybindings\n\n| Menu       | In Game                 | Keyboard | Controller: Mapping A  | Controller: Mapping B  |\n| :--------- | :---------------------- | :------: | :--------------------: | :--------------------: |\n| Move Up    |                         |    ↑     |           ↑            |           ↑            |\n| Move Down  | Soft Drop               |    ↓     |           ↓            |           ↓            |\n| Move Left  | Move Left               |    ←     |           ←            |           ←            |\n| Move Right | Move Right              |    →     |           →            |           →            |\n|            | Rotate Clockwise        |    X     |         A (→)          |         B (↓)          |\n| Back       | Rotate Counterclockwise |    Z     |         B (↓)          |         Y (←)          |\n| Start      | Pause/Resume            |  Enter   |         Start          |         Start          |\n| Soft Reset | Soft Reset              |   Esc    | Select + Start + A + B | Select + Start + B + Y |\n\n\u003e A, B, X, and Y button mapping is in NES/SNES Controller layout.\n\n## Build \u0026 Run\n\n### Web\n\n```sh\ncargo build --release --target wasm32-unknown-unknown\nwasm-bindgen --no-typescript --target web --out-dir ./dist/tetris --out-name \"tetris\" ./target/wasm32-unknown-unknown/release/tetris.wasm\ncp -r ./assets ./dist/assets\n\n# Start a web server to serve the files under \"./dist\"\n# ex: npx serve -l 8080 ./dist\n```\n\n### Linux\n\n[Install Linux dependencies](https://github.com/bevyengine/bevy/blob/main/docs/linux_dependencies.md)\n\nUbuntu\n\n```sh\nWGPU_BACKEND=vulkan cargo run --release\n```\n\n\u003e The OpenGL backend is broken, run with the Vulkan backend instead.\n\n### Windows \u0026 MacOS\n\n```sh\ncargo run --release\n```\n\n## License\n\nThis project is free, open source, and permissively licensed! Except where noted (below and/or in individual files), all code in this repository is dual-licensed under either:\n\n- MIT License ([LICENSE-MIT](https://github.com/Ramirisu/tetris/blob/main/LICENSE-MIT) or https://opensource.org/license/MIT)\n- Apache License, Version 2.0 ([LICENSE-APACHE](https://github.com/Ramirisu/tetris/blob/main/LICENSE-APACHE) or https://www.apache.org/licenses/LICENSE-2.0)\n\nat your option. This means you can select the license you prefer!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framirisu%2Ftetris","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Framirisu%2Ftetris","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framirisu%2Ftetris/lists"}