GithubHelp home page GithubHelp logo

nnluukhtn / flatris Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ovidiuch/flatris

0.0 3.0 0.0 928 KB

Flatris is demo app for Cosmos, built using React components.

Home Page: http://skidding.github.io/flatris

JavaScript 92.08% HTML 1.56% CSS 6.36%

flatris's Introduction

Flatris

Take a trip down memory lane with one the classics and play some Flatris!

Flatris is a demo app for the Cosmos project, built using React components.

The purpose of this demo is to prove that data can drive a user interface, even one as complex as a game. A snapshot of the game state can be generated at any time by calling Flatris.serialize() in the browser console of the demo page. This will reveal the data structures on top of which the game is built.

For more insights check out the source code and Cosmos.

Thanks @paulgergely for the flat Tetris design!

Components

SquareBlock

Building block for Tetriminos and the grid of the Well, occupying a 1x1 square block. The only configurable property square blocks have is their color.

Tetrimino

A Tetromino is a geometric shape composed of four squares, connected orthogonally. Read more at http://en.wikipedia.org/wiki/Tetromino

WellGrid

Isolated matrix for the landed Tetriminos inside the Well.

Well

A rectangular vertical shaft, where Tetriminos fall into during a Flatris game. The Well has configurable size and speed. Tetrimino pieces can be inserted inside the well and they will fall until they hit the bottom, and eventually fill it. Whenever the pieces form a straight horizontal line it will be cleared, emptying up space and allowing more pieces to enter afterwards.

GamePanel

The game panel contains:

  • The next Tetrimono to be inserted
  • The score and lines cleared
  • Start or pause/resume controls

It is displayed on the right side of the game.

InfoPanel

Information panel for the Flatris game/Cosmos demo, shown in between game states.

FlatrisGame

The Tetris game was originally designed and programmed by Alexey Pajitnov. It was released on June 6, 1984 and has since become a world-wide phenomenon. Read more about the game at http://en.wikipedia.org/wiki/Tetris

FlatrisStatePreview

Render a Flatris instance next to its prettified, serialized state.

FlatrisStatePersistor

Persist Flatris state with local storage.

Development

npm install
node_modules/.bin/webpack

flatris's People

Contributors

ovidiuch avatar

Watchers

James Cloos avatar Luu Nguyen avatar  avatar

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.