Copyright | (c) 2017 Samuel Tay <sam.chong.tay@gmail.com> |
---|---|
License | BSD-style (see LICENSE) |
Maintainer | Mario Lang <mlang@blind.guru> |
Safe Haskell | None |
Language | Haskell2010 |
A library implementation of Tetris.
This module has been taken from https://github.com/SamTay/tetris
Synopsis
- data Game
- data Direction
- boardWidth :: Int
- boardHeight :: Int
- initGame :: Int -> IO Game
- isGameOver :: Game -> Bool
- timeStep :: Game -> IO Game
- rotate :: Game -> Game
- shift :: Direction -> Game -> Game
- hardDrop :: Game -> Game
- board :: Lens' Game Board
- shape :: Lens' Block Tetrimino
- score :: Lens' Game Int
- block :: Lens' Game Block
- coords :: Block -> [Coord]
Documentation
Game state
boardWidth :: Int Source #
Visible, active board size
boardHeight :: Int Source #
Visible, active board size
isGameOver :: Game -> Bool Source #
rotate :: Game -> Game Source #
Handle counterclockwise block rotation (if possible) Allows wallkicks: http://tetris.wikia.com/wiki/TGM_rotation