I am a new pygame user and I have a problem. I want to move an image with pygame.Rect but it's not working. I learn pygame from Tech With Tim. Here is the whole code.
import pygame
win = pygame.display.set_mode((800,600))
run = True
image = pygame.image.load("spaceship.png")
image = pygame.transform.scale(image,(50,50))
while run:
for event in pygame.event.get():
if event.type == pygame.QUIT:
run = False
win.fill((255,255,255))
red = pygame.Rect(50,50,50,50)
win.blit(image,(red.x,red.y))
red.x += 1
pygame.display.update()
Thanks!