Skip to content

Knight-Night-666/Tetris-using-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 

Repository files navigation

ABSTRACT:

Our project aims to recreate the iconic tile matching game ‘TETRIS’. Being new to non-trivial programming, we used the concepts of OOPS combined with beautiful python modules like Pygame, which enables real-time game development without low level languages. With basic graphics and programming, we were able to implement Tetris in a fun and modern twist, with fun background music, sounds, and images.

Major Takeaways:

  • Exposure to python modules like Pygame.
  • Real-life application of concepts being taught to us in college.
  • Moving beyond assignments and implementing logics of the games we generally play, hence getting a basic sense of the front and back-end development of games.

INTRODUCTION:

The game uses the following controls:

  1. Mouse controls for the buttons in the Main Menu

  2. Arrow Keys-Left and Right to move the Tetris blocks sideways

  3. Upward arrow to change rotation of current block

  4. Downward arrow to increase the falling speed of the current block

  5. Escape Button-To exit to the main menu at any time during/After the game

Code Overview:

  • Using classes to return shapes (randomly chosen shape and its rotation), to define the working of the game checking for intersections and rows filled with tiles.
  • Using functions to Execute the movement, rotation, clearing and generation of blocks, updating current score and high score.
  • Using functions to Create a Main Menu, Game Menu and Instructions page.

In all of the above, pygame functions were used for the ease of implementing the required graphics, as well as adding visual and audio real time effects.

SYSTEM REQUIREMENTS:

System requirements: Courtesy the beauty of the Pygame module, basic system requirements enable us to build the game- OS: 64-bit Windows 7 or later or OS X 10.11 or later, Processor: 1.5GHz or faster, Memory: 4GB (4,096MB) RAM , Free HDD space: 3GB, Hardware: keyboard, mouse, and headset with microphone.

The Pygame module, along with Python3 software need to be installed as well.

DEMONSTRATION

  • GameMenu() function is called - Instructions() function is called
  • Buttons are made which lead to when the help button is pressed

different pages. in the main menu.

The game in action: - Game over state, reached after

  • Left and right arrow keys to move the pieces accordingly play area is exhausted.
  • Up arrow to rotate, down arrow to increase speed
  • The image on the left has a full line which will be cleared
  • Image on the right shows a state with no play space left

FUTURE OUTLOOK:

  • A seemingly simple game like Tetris could well be modified in many ways

  • Harder levels with larger boards and faster block drops.

  • Making an AI which can beat the game, or set an incredibly high score to beat.

  • Multiplayer mode with real-time competition

  • Customization in Controls, Aesthetics, and Audio.

  • Many such retro-arcade games can be made together in a similar fashion to make a Modern time Retro-Arcade to relive some of the old classic games with a fun new twist.

  • Exploring Pygame and other python modules to make the game files more compact, efficient and easier to execute in any type of system.

About

eet izz wut eet izz

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages