Giter Club home page Giter Club logo

tetris's Introduction

A recreation of the classic game of Tetris in Python.

Fully functional, this program allows users to play tetris in a simple graphical user interface built with Python's tkinter module. Like all tetris games, you can move, rotate, hold, and drop pieces with simple controls. These controls are all processed in tkinter's event loop with a secondary thread being run in the background to continously lower tetris pieces at increasing speeds. Players place blocks and clear lines until, eventually, they can't catch up. Each line cleared adds to their score that is displayed throughout and at the end, when the program asks if the user wants to play again.

Some of the techniques used in this project:

  • GUI Design (with tkinter)
  • Threading
  • Image Manipulation (with PIL)
  • Object-Oriented Programming
  • Inheritance

This project was in independent project created during the Fall semester of my Freshman year at Missouri S&T. It was concieved and developed in a period of 10 days.

Requirements:

Python == 3.9.1
Pillow == 8.3.2

There are two versions of this program. The first is the 'Simple' version, which includes all developments up to the introduction of gridlines in the background of the gamefield. The second version generates gridlines in the backgrounds of images and puts textures on individual blocks. These versions are separated in case machines with low computational power (something like a Raspberry Pi) has trouble with these image manipulations.

tetris's People

Contributors

djcubed12 avatar

Watchers

 avatar

tetris's Issues

Threading issue and tkinter shutdown issue

Occasionally on shutdown, the thread running the loop that drops pieces does not seem to end. Possibly related is another occasional problem where upon shutdown, the Play Again? messagebox reappears and once closed opens a new blank toplevel.

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.