pixelart pygame code example
Example: pixelart pygame
# Simple pygame project for pixelart
import pygame
screen = pygame.display.set_mode((1280, 720))
pixelart_surface = pygame.Surface((512, 288))
running = True
while running:
pixelart_surface.fill((0, 0, 0))
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
pygame.draw.rect(pixelart_surface, (255, 0, 0), ((10, 10), (50, 50)))
screen.blit(pygame.transform.scale(pixelart_surface, (screen.get_width(), screen.get_height())), (0, 0))
pygame.display.update()
pygame.quit()