159
MAX_PADDLE_X = SCREEN_SIZE[0] - PADDLE_WIDTH
MAX_BALL_X = SCREEN_SIZE[0] - BALL_DIAMETER
MAX_BALL_Y = SCREEN_SIZE[1] - BALL_DIAMETER
PADDLE_Y = SCREEN_SIZE[1] - PADDLE_HEIGHT - 10
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
BLUE = (0, 0, 255)
BRICK_COLOR = (200, 200, 0)
# ой ын жағ дайы
STATE_BALL_IN_PADDLE = 0
STATE_PLAYING = 1
STATE_WON = 2
STATE_GAME_OVER = 3
class Bricka:
def __init__(self):
pygame.init()
self.screen = pygame.display.set_mode(SCREEN_
SIZE)
pygame.display.set_caption("IGRA")
self.clock = pygame.time.Clock()
if pygame.font:
self.font = pygame.font.Font(None,30)
else:
self.font = None
self.init_game()
def init_game(self):
self.lives = 3
self.score = 0
self.state = STATE_BALL_IN_PADDLE
self.paddle = pygame.Rect(300,PADDLE_Y,PADDLE_
WIDTH,PADDLE_HEIGHT)
Достарыңызбен бөлісу: