# Example file showing a circle moving on screen
import pygame
# pygame setup
pygame.init()
screen = pygame.display.set_mode((1280, 720))
clock = pygame.time.Clock()
running = True
dt = 0
changed = False
player_pos = pygame.Vector2(screen.get_width() / 2, screen.get_height() / 2)
while running:
# poll for events
# pygame.QUIT event means the user clicked X to close your window
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
# fill the screen with a color to wipe away anything from last frame
screen.fill("white")
pygame.draw.rect(screen, 'black', (340, 60, 600, 600), 8)
pygame.draw.rect(screen, 'black', (480, 60, 160, 600), 8)
pygame.draw.rect(screen, 'black', (632, 60, 160, 600), 8)
pygame.draw.rect(screen, 'black', (340, 200, 600, 160), 8)
pygame.draw.rect(screen, 'black', (340, 352, 600, 160), 8)
# flip() the display to put your work on screen
pygame.display.flip()
# limits FPS to 60
# dt is delta time in seconds since last frame, used for framerate-
# independent physics.
dt = clock.tick(60) / 1000
pygame.quit()
top of page

실제 작동 상태를 확인하려면 라이브 사이트로 이동하세요.
2025-08-29 숙제
2025-08-29 숙제
댓글 2개
좋아요
댓글(2)
더 이상 게시물에 대한 댓글 기능이 지원되지 않습니다. 자세한 사항은 사이트 소유자에게 문의하세요.
bottom of page



screen.blit(text, [390, 100]) screen.blit(text, [390, 250]) screen.blit(text, [390, 400]) screen.blit(text, [390, 550]) screen.blit(text, [540, 100]) screen.blit(text, [540, 250]) screen.blit(text, [540, 400]) screen.blit(text, [540, 550]) screen.blit(text, [690, 100]) screen.blit(text, [690, 250]) screen.blit(text, [690, 400]) screen.blit(text, [690, 550]) screen.blit(text, [840, 100]) screen.blit(text, [840, 250]) screen.blit(text, [840, 400]) screen.blit(text, [840, 550])