Giter Club home page Giter Club logo

t3tr0s's Introduction

Click to Play!

We are re-creating Tetris™ in ClojureScript. We are mainly doing this to produce the pleasure and to celebrate the 30th anniversary of its original release in 1984. Our remake will enable us to host a small, local tournament and to share a montage of the game's history, with each level resembling a different version from its past. (We are working on the game at least once a week):

  • DevBlog 1 - data, collision, rotation, drawing
  • DevBlog 2 - basic piece control
  • DevBlog 3 - gravity, stack, collapse, hard-drop
  • DevBlog 4 - ghost piece, flash before collapse
  • DevBlog 5 - game over animation, score
  • DevBlog 6 - level speeds, fluid drop, improve collapse animation, etc.
  • DevBlog 7 - draw next piece, tilemap for themes
  • DevBlog 8 - allow connected tiles for richer graphics
  • DevBlog 9 - live board broadcasting
  • DevBlog 10 - chat room, more tilemaps, page layouts
  • DevBlog 11 - page routing, username

Setup

  1. Install Leiningen and Node.js.

  2. Run the following in the project directory

    # install node.js dependencies
    npm install
    
    # compile LESS file
    grunt
    
    # compile ClojureScript files (this may take a minute)
    lein cljsbuild once
    
    # copy the example config file (edit as needed)
    cp example.config.json config.json
    
    # start the node.js server
    node server.js
  3. Open http://localhost:1984 in your browser.

Browser REPL

If you want a REPL connected to the browser for interactive testing:

lein repl
> (brepl)

Recording GIFs

If you want to record a GIF of gameplay:

  1. Create empty "gif" directory at the project root.

  2. Play the game in the browser (with the developer console open).

  3. Press "shift" to start/stop recording. (watch the console)

  4. To write the recording to a file, type this in the browser REPL:

    (ns client.vcr)
    (publish-record!)
  5. In the "gif" folder, you should see "anim.gif" and intermediate PNG frames.

References

License

All code licensed under the terms of the MIT License.

The image files of past versions of the games (ie: the tilemap files) belong to their respective copyright holders.

Tetris is a registered trademark of The Tetris Company.

t3tr0s's People

Contributors

dudemullet avatar imalooney avatar oakmac avatar pgambling avatar shaunlebron avatar

Watchers

 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.