Skip to content

dprien/rstetris

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rstetris

An implementation of the game Tetris, targeting WebAssembly, written in Rust with no external dependencies.

How to play

  1. Install the wasm32-unknown-unknown target with rustup:
    rustup target add wasm32-unknown-unknown
    
  2. Download and build the game:
    git clone https://github.com/dprien/rstetris.git
    cd rstetris
    cargo build --release --target=wasm32-unknown-unknown
    
  3. Start a local webserver to serve the games' files:
    python -m http.server 8000 --bind 127.0.0.1 --directory web/
    
  4. Point your favorite browser to http://127.0.0.1:8000.

Controls

Keyboard

  • Space - Start a new game (on title or "Game Over" screen)
  • Esc - Abort the current game
  • A / D - Move left / right
  • S / W - "Soft" / "Hard" drop
  • / - Rotate counter-clockwise / clockwise

Touch screen

  • Swipe up - Start a new game (on title or "Game Over" screen)
  • Swipe left / right - Move left / right
  • Swipe down - "Soft" drop
  • Swipe up - "Hard" drop
  • Tap - Rotate clockwise

Project goals & planned features

License

This project is licensed under the GNU General Public License v3.0 (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.html).