Hey I am new to python and pygame. I started to program simple things in python and wanted to try coding a game now. Why is my only output a blank window?
import pygame
pygame.init()
window = pygame.display.set_mode((800, 600))
pygame.display.set_caption("Dungeon")
class Living:
def __init__(self, x, y, height, width, health):
self.x = x
self.y = y
self.height = height
self.width = width
self.health = health
run = True
while run:
pygame.time.delay(100)
for event in pygame.event.get():
if event.type == pygame.QUIT:
run = False
hero = Living(50, 50, 30, 20, 100)
pygame.draw.rect(window, (255, 0, 0), (hero.x, hero.y, hero.height, hero.width))
pygame.display.update()
pygame.quit()