1 unstable release
0.1.0 | Jan 21, 2023 |
---|
#977 in Game dev
34KB
920 lines
tetris-core
This library provides the core functions of Tetris.
How to use
- Install this crate.
- Make a block kind selector.
use tetrice::BlockKind; fn selector() -> BlockKind { // Return one of the kinds (probably you want to select randomly) }
- 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
lib.rs
:
This crate provides core functions of Tetris.
How to use
- Install this crate.
- Make a block kind selector.
use tetrice::BlockKind; fn selector() -> BlockKind { // Return one of the kinds (probably you want to select randomly) # BlockKind::T }
- 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`! }