tetrice

Crates.iotetrice
lib.rstetrice
version0.1.0
sourcesrc
created_at2023-01-21 15:07:07.934232
updated_at2023-01-21 15:07:07.934232
descriptionProvides the core functions of Tetris
homepage
repositoryhttps://github.com/tetraliane/tetris-core
max_upload_size
id764371
size45,002
Tetraliane (tetraliane)

documentation

README

tetris-core

This library provides the core functions of Tetris.

How to use

  1. Install this crate.
  2. Make a block kind selector.
    use tetrice::BlockKind;
    
    fn selector() -> BlockKind {
        // Return one of the kinds (probably you want to select randomly)
    }
    
  3. Create a game.
    use tetrice::Game;
    
    fn main() {
        // Create a game which has a 10x20 field and provides 3 next tetriminos
        let mut game = Game::new(10, 20, 3, Box::new(selector));
        // Now you can move, rotate, etc. using `game`!
    }
    

Documentation

cargo doc --package tetris
Commit count: 14

cargo fmt