Giter Site home page Giter Site logo

tetris's Introduction

tetris by pygame

tetris implemented using pygame There are three modes to play, single play, online play and cpu play. Note that server should be deployed at some place if you want to play online mode.

DEMO

Menu Screen Image of Demo Play Single Play Image of Demo Play Online Play Image of Demo Play Play with AI Image of Demo Play

Features

This version of tetris basically follows the rule from Tetris DS. Super Rotation System is used to determine how each rotation affects the current mino's position.

How to play

python tetris.py

To play online mode, you should edit network configuration in src/server/main.go, src/network_config.py, and deploy the execution file created by following command.

go build

To play the mode of challenge AI, make sure there is a pit file in the same directory as tetris.py. The default pit file, tetris-best_475.pit, is the model trained by here.

Requisite

pygame numpy torch gym

Key Mapping

a ... move left

s ... move right

w ... hard drop

z ... soft drop

space bar ... hold

right arrow ... rotate clockwise

left arrow ... rotate counterclockwise

License

This software is released under the MIT License, see LICENSE.txt.

tetris's People

Contributors

froprintoai avatar

Stargazers

Takumi Mori avatar Kashu Yamazaki @CVPR2024 avatar

Watchers

James Cloos 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.