A simple 'Tetris'-Clone in Python with PyGame.
-Score Counter
-Blocks can be rotated
-Lines get deleted if they are full of blocks
-Blocks spawn in random colours
-Game restarts when space is pressed on 'Game Over'
-Space: Blocks fall
-Left / Right: Move Blocks
-Up / Down: Rotate Blocks
Initializes PyGame. Creates the screen and clock variables. Sets the window title.
Initializes the 2D List where the block data is stored. The active element is NOT stored inside of this list. It contains only static blocks.
Creates a new block. A new block is created at the start of the game and when a block cant move anymore.
The Shape of the block and its colour is selected via random choice and colour.
Rotates a active element around its centerpoint. Centerpoint is calculated by the average of all positions. Rotation only happens if the object doesnt collide with existing blocks, or the world boundary.
Moves the active element into a specified direction. Moving only happens if the target location is valid.
Adds the current active element to the static world.
Draws all pytris blocks of update_worldthe world to the screen.
Draws only the active element to the screen.
Contains the game loop.
