Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pygame_sdl2
- pygame_sdl2.import_as_pygame()
- import pygame
- import time
- # define some colors
- BLACK = (0, 0, 0)
- WHITE = (255, 255, 255)
- pygame.init()
- pygame.font.init()
- DS = pygame.display.set_mode((640, 480))
- CLOCK = pygame.time.Clock()
- FPS = 30
- W = DS.get_width()
- H = DS.get_height()
- HW, HH = int(W / 2), int(H / 2)
- FONT = pygame.font.SysFont("'", 75)
- start = time.time()
- while True:
- DS.fill(BLACK)
- t = str(int(time.time() - start))
- text = FONT.render(t, True, WHITE)
- DS.blit(text, (0, 0))
- pygame.display.update()
- CLOCK.tick()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement