123456789101112131415161718192021222324 |
- import pygame
- from pygame.locals import *
- if __name__ == "__main__":
- pygame.init()
- surface = pygame.display.set_mode((1000, 500))
- surface.fill((255, 255, 255))
- block = pygame.image.load("resources/block.jpg").convert()
- block_x = 100
- block_y = 100
- surface.blit(block, (block_x, block_y))
- pygame.display.flip()
- is_running = True
- while is_running:
- for event in pygame.event.get():
- if event.type == KEYDOWN:
- if event.key == K_ESCAPE:
- is_running = False
- elif event.type == QUIT:
- is_running = False
|