Git Product home page Git Product logo

pytetris's Introduction

pytetris

Python implementation of the Tetriss game, following the challenge @ GitHub.

Running the game

To start the game, simply run gui.py.

  • movement arrows move the pieces left, right and downwards
  • a and d rotate the piece
  • x moves the piece to the bottom

Screenshot

Console

It is also possible to run tetris.py from console, and control it using the following commands:

  • q: quits the game
  • @: sets the game at the menu
  • !: starts/pauses the game
  • p: prints the current status (menu, pause, or current grid depending on the status)
  • P: displays the grid with only the active piece
  • g: takes as input a given grid
  • c: clears the grid
  • s: steps (checks for full lines)
  • ?s: displays score
  • ?n: displays number of cleared lines
  • I: adds an 'I' tetramino
  • J: adds a 'J' tetramino
  • L: adds an 'L' tetramino
  • O: adds an 'O' tetramino
  • S: adds an 'S' tetramino
  • T: adds a 'T' tetramino
  • Z: adds a 'Z' tetramino
  • ): rotates active tetramino clockwise
  • (: rotates active tetramino counter clockwise
  • <: moves active tetramino to the left
  • >: moves active tetramino to the right
  • v: moves active tetramino one step down
  • V: moves active tetramino to the bottom
  • t: displayes local grid of the active tetramino
  • ;: prints an empty line

The file tetris.py will also pass all the tests of the challenge.

pytetris's People

Contributors

robin-vjc avatar dhmo1900 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.