Use Typescript to Implement Classic Tetris Game
Comply with FRP Style and Code Pure
- Observable
- Using RxJS to create multiple Observable streams and merge together to form an Observable
- The control of the main game process is completely put into the pipeline of
source$
- Functional Programming
- Disable for-loop
- Using
reduce()
,map()
andfilter()
to conform to FRP style - Make full use of higher order function
- State Management
- One single state to manage game's state
- Code purity
- Event Processing
- Listening
KeyboardEvent
andMouseEvent
- Listening
- Tetris
- Blocks move down from the top discretely
- All Tetris Pieces that can be built using 4 blocks
- Marking Board
- Row Elimination
- Random Next Shape
- Next Shape Preview
- Difficulty Increase
- Game Restart
- Advanced Feature
- Power-up Block
- Eleminate Three Rows
- Debuff Block
- Destroy Around Four Blocks
- Power-up Block
- Blocks move down from the top discretely
Setup (requires node.js):
> npm install
Start tests:
> npm test
Serve up the App (and ctrl-click the URL that appears in the console)
> npm run dev