Giter Club home page Giter Club logo

tetris's Introduction

Check the Wiki for more information on how this game is being made.

Tetris

Tetris is a popular retro game, where a random sequence of pieces composed of four square blocks fall down the playing grid. The object of the game is to manipulate these pieces, by moving each one sideways and rotating it counterclockwise by 90 degree units in order to create a horizontal line of blocks without gaps. When such a line is created, it disappears, and any block above the deleted line will fall.

If you have never played Tetris before, take a look at http://en.wikipedia.org/wiki/Tetris.

There are seven pieces in Tetris, each composed of four blocks and with its own colour. When the game starts, an empty board is displayed; the standard board is 10 x 20 cells. A Tetris piece, chosen randomly from the seven possible Tetris pieces, appears at the top of the board as the piece in play. The • dot in the pieces above is not seen on the screen; it indicates the square that will be placed in the cell at the top row and sixth column to the right. This piece should fall by moving down the board, one row at a time. A piece cannot fall into a square already occupied by a previously fallen piece (i.e., the pile). When a piece can fall no further, it stops moving.

Pieces can be rotated or moved left/right, while they are falling as long as they do not fall out of the grid. Left/right movement shifts the piece one square. Rotation is counter-clockwise by ninety degrees. The diagram below shows the rotations of the pieces; you will notice that the • dot also indicates the centre of the rotation. The player can also drop the piece to the floor / pile. By dropping a piece, the piece simply free-falls down as far as it can.

###Language C#

###Version 1.0 (+) Library for business class
(+) Business Classes structure (found in wiki)
(+) Unit Testing Project & Corresponding classes (in the works)

###Version 2.0 (+) Logic Completed
(+) Unit Testing Structure
(+) Required unit testing complete

###Version 3.0 (+) Add a MonoGame Project
(+) Add a Tetris icon

tetris's People

Contributors

jeegnathebug avatar tiffafoo avatar

Watchers

 avatar

tetris's Issues

Add BoardSprite class

The BoardSprite is responsible for drawing the Board (thepile is distinguished from the rest by its Colors).

Improve Project (Optional)

1.implement a more intelligent pile-clearing algorithm. Instead of simply deleting a filled row, and descending all rows above, implement a flood fill algorithm.
2- show the next shape
3- allow the player to hold a piece for later use
4- enable clockwise rotation
5- show "ghost" shapes that indicate where the shape would fall if there was no further manipulation
6- Allow the player to pause/resume the game at any time.
7- Add music!
8- Save and read the high score from a file. Save one or multiple high scores, with the players' gamertags

Add ShapeSprite class

The ShapeSprite class is responsible for rendering the activeshape, as well as collecting keyboard input.

ShapeSprite is responsible for asking the current piece to move down. The frequency withwhich this happens is based on the level:dropDelay = (11-level) * 0.05 seconds

Add ScoreSprite class

The ScoreSprite is responsible for writing score-relatedinformation, such as the level, number of lines cleared, and the score.

Add Game1 class

The Game1 class instantiatesthe appropriate business classes and the sprites, and adds the sprites to its components list. It alsoobserves the Board class to know when the game is over: at that stage it will remove the ShapeSpritefrom the components so that it is out of the game loop, and informs the ScoreSprite so that a messageis displayed.

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.