User8574
Active Coder
Python:
# Modules
import pygame, sys
# Init / Clock
pygame.init()
clock = pygame.time.Clock()
# Display Setup
screen_width = 1920
screen_height = 1080
screen = pygame.display.set_mode((screen_width,screen_height))
pygame.display.set_caption("Coin Collector")
# Objects
coin = pygame.image.load("coin.png").convert()
# Colors
bg_color = pygame.Color(255, 255, 255)
# Event Loop
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
# Object Draw / Blit
screen.fill(bg_color)
screen.blit(coin, (screen_width/2, screen_height/2))
# Screen Update
pygame.display.flip()
clock.tick(60)
Both filling the background and making the coin appear on the screen doesn't work; why?