Skip to content

Instantly share code, notes, and snippets.

@gcr
Created March 3, 2009 18:22
Show Gist options
  • Select an option

  • Save gcr/73439 to your computer and use it in GitHub Desktop.

Select an option

Save gcr/73439 to your computer and use it in GitHub Desktop.
#Tetris
import pygame
from pygame import *
import time
from palikka import Palikka
pygame.init()
pygame.display.set_caption('Tetris')
max_x = 640
max_y = 480
screen = tausta = pygame.display.set_mode((max_x, max_y))
nelio = Palikka('block.png', max_x, max_y)
tausta = pygame.Surface(screen.get_size())
tausta = tausta.convert()
tausta.fill((255, 255, 255))
looping = True
while looping:
for event in pygame.event.get():
if event.type == QUIT:
looping = False
if event.type == KEYDOWN:
if event.key == K_LEFT:
nelio.move_left()
if event.key == K_RIGHT:
nelio.move_right()
screen.blit(tausta, (0, 0))
nelio.draw(screen)
pygame.display.flip()
time.sleep(2)
pygame.quit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment