So I am working on a project that needs a function to be duplicated and not let any space between all the shapes.
Basically, my problem is that I can find the way.
Code:
# importing modules
import pygame
import sys
import random
# colors
white = (255, 255, 255)
blue = (0, 0, 255)
red = (255, 0, 0)
green = (4, 255, 0)
brown= (165,42,42)
# starting pygame
pygame.init()
# making a screen
(width, height) = (500, 500)
screen = pygame.display.set_mode((width, height))
pygame.display.set_caption('Mincraft')
running = True
# fps counter
clock = pygame.time.Clock()
print(clock)
def grass_block(green,brown):
pygame.draw.rect(screen, green, (395, 0, 90,50))
pygame.draw.rect(screen, brown, (395, 10, 90,50))
pygame.draw.rect(screen, brown, (395, 20, 90,50))
# geting the x button to work
while running:
grass_block(green,brown)
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
pygame.display.update()
clock.tick(60)
pygame.display.quit()
pygame.quit()
exit()
Side questions id=f someone could transform the rect to a 3d object and make every side with a texture?
Thanks, everyone who responds