Code Monkey home page Code Monkey logo

tetris's Introduction

Tetris

TODO: Do this in Scala and make tetromino generation cleaner

Background

Tetris is played by maneuvering geometric shapes called "tetrominos" as they fall down the "matrix." A tetromino consists of four square blocks, and the matrix is a playing field that is 10 blocks wide by 20 blocks high. The objective of the game is to manipulate these tetrominos to create a horizontal line of ten blocks spanning the matrix without gaps. When such a line is created, it disappears, and the blocks above will shift to take their new places. When a certain number of lines are "cleared", the game enters a new level. As the game progresses, each level causes the tetrominos to fall faster, and the game ends when the stack of tetrominos reaches the top of the playing field and no new tetrominos are able to enter. In this implementation, completing 15 levels is a player victory.

Features

  • Hold button
  • Queue preview
  • SRS (Super Rotation System scheme) implementation (floor and wall kicks)
  • Randomization per 7-piece bag (interesting implementation)
  • Scoring and line clearing closely emulates Tetris Marathon mode
    • No distinction between Mini and non-Mini T-Spins since lame factor

Minor Features

  • Tetromino sprites
  • Elapsed time
  • Lines cleared
  • Used custom font file
  • Game pause on focus loss

Controls

Key Function
Z Rotate left
X Rotate right
[LEFT] Move left
[RIGHT] Move right
[UP] Soft drop
[DOWN] Hard drop
[SHIFT] Hold
[ESC] (Un-)Pause

Things to Implement

* Delayed auto shift (key autorepeat rate) setting 
* Darker shade of blocks already locked down (to distinguish from active tetrominos)
* Line clear animation
* Name of the line clear performed
* Sound effects

tetris's People

Contributors

lyze avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

tetris's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.