This is a simple python game, use left and right arrows to move left and right. # tetris import pygame , sys , random , time from pygame.locals import * SCREEN_WIDTH = 640 SCREEN_HEIGHT = 480 BOARD_WIDTH = 10 BOARD_HEIGHT = 20 SQUARE_SIZE = 20 # coordinates of the board's top-left corner START_POS = ( 218 , 78 ) # fps FPS = 30 # color set up WHITE = ( 255 , 255 , 255 ) BLACK = ( 0 , 0 , 0 ) RED = ( 255 , 0 , 0 ) GREEN = ( 0 , 255 , 0 ) BLUE = ( 0 , 0 , 255 ) LIGHT_GREEN = ( 144 , 238 , 144 ) # define shapes # T shape data structure t_shape = [[ ' ' , ' * ' , ' *** ' , ' ' , ' ' , ], [ ' ' , ' *** ' , ' * ' , ' ' , ' ' , ], [ ' ' , ' * ' , ' ** ' , ' * ' , ' ...
Comments
Post a Comment