Coder Social home page Coder Social logo

tetris2022's People

Watchers

 avatar Joel avatar

tetris2022's Issues

Block collision

When a block collides with any tiles on the gameboard (that aren't owned by this block), the block effectively disbands and the tiles become static.

Block implementation

Tetris won't work without grouping tiles together into their full-blown tetris blocks.

Go ahead and implement the basic skeleton for blocks, or groups of tetris tiles.

  • The datastructure, along with some helpful helper functions.
  • One way or another, a block will have to have its tiles mapped onto the gameboard.
  • Blocks should be able to "rotate" their grouping of tiles on the game board.

Implementation notes:
The datastructure itself could either be via abstraction, with each type of block being made by inheriting the base.
Alternatively, it could use composition, where there is a single Type (think: class, but rust doesn't have a notion of "classes") for a block, and helper functions which create the different types of blocks using this Type.

Tile datastructure

We need a way to store some information about individual tiles, or blocks that make up the tetris pieces.

Some things such as:

  • Color
  • Position

'Hold block'

The player should be able to 'hold' the current block upon pressing a key, which stores this block for later use.
Upon holding a block, the next block should spawn.
To retrieve the previously held block, the player should hold the current block which effectively swaps the held block and the current block.

Need to prevent exploitation of this. If the player rapidly presses the key to hold the current block, then the blocks will avoid falling down and thus giving the player extra time.

Tile representation

Like the board, we need a couple of features completed to consider this feature itself complete:

Gui

Implement a gui for the game, including a highscore table, an options menu, etc.

Draw gameboard

We need to draw the game board's background and any other graphics associated with the playing area (ie, borders)

Render tiles

We need to be able to visually see the tiles (or individual pieces of the tetris blocks) in the game.
They should be drawn at the appropriate x/y position on the gameboard.

New blocks

As a result of the collision implemented in #11, once a block is disbanded a new block should spawn in at the top of the gameboard.

Sound

Add in background music and sound effects.

Datastructure for the game board

We need a data structure to represent the game board.
Something to keep in mind when implementing this is that the board needs to be mutatable and provide line clearing functionality.

Level clearing

When a row on the gameboard is completely filled with tiles, it should clear the row and all tiles above (except those owned by a block) should be moved down by a single row.

"Falling" blocks

Blocks need to be able to fall down the gameboardm, as if with gravity.
Ensure block rotation doesn't break as a result of this story's work ๐Ÿ˜„.

Game progression

As the player's score increase, so does the fall-speed of the blocks.

Basically make the game more difficult as the player scores points.

We can do this linearly, for each row the player clears increase the speed.
Or level-based. For every x rows cleared, the player increases the level. Each level then has a significant increase in speed.
Remember to render the level the player is on somewhere?

Score

We need a scoring system.
Traditionally, the player receives points for clearing lines.

Also render this score on the screen somewhere.

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.