Untitled
unknown
abc
2 years ago
609 B
6
Indexable
import pygame pygame.init() done = False WIDTH = 720 HEIGHT = 480 TITLE = "Game" FPS = 60 screen = pygame.display.set_mode((WIDTH, HEIGHT)) pygame.display.set_caption(TITLE) clock = pygame.time.Clock() main_font = pygame.font.SysFont("Arial", 20) # main event loop while not done: #events for event in pygame.event.get(): if event.type == pygame.QUIT: done = True screen.fill((0, 200, 0)) hello = main_font.render("Hello world", True, (0,0,0)) screen.blit(hello, (40, 40)) pygame.display.flip() clock.tick(FPS)
Editor is loading...