Hello basicly i'm trying to make minecraft in 2D pygame. But I am stuck in this issue.
import pygame background_colour = (173,216,230) (width, height) = (600,800) screen = pygame.display.set_mode((width, height)) pygame.display.set_caption('2D MINECRAFT') screen.fill(background_colour) rectangle1 = pygame.Rect(10, 30, 50, 70) brown = 160,82,45 pygame.draw.rect(screen, brown, rectangle1) rectangle1.setPosition() pygame.display.flip() running = True while running: for event in pygame.event.get(): if event.type == pygame.QUIT: running = False
I need to change the rectangle's position.
I tried to use rectangle1.setPosition(); (without searching google because i did not find anything ) an error came that pygame.Rect.Setposition(); is not an atribute