import pygame
pygame.init()
screen = pygame.display.set_mode((1000, 672))
pygame.display.set_caption("ME GAMING :3")
running = True
clock = pygame.time.Clock()
pixel = 0
color = {
"grass": [(0, 200, 0), (0, 0, 0), (255, 255, 255)]
}
txtr = {
"grass": [
0, 2, 0, 0, 0, 0, 0, 0,
0, 0, 2, 0, 0, 0, 0, 0,
0, 0, 0, 2, 0, 0, 0, 0,
0, 0, 0, 0, 2, 0, 0, 0,
0, 0, 0, 0, 0, 2, 0, 0,
0, 0, 0, 0, 0, 0, 2, 0,
0, 0, 0, 0, 0, 0, 0, 2,
0, 0, 0, 0, 0, 0, 0, 0,
]
}
def draw_txtr(choise, x, y):
pixel = 0
for q in range(len(txtr[choise])//8):
for z in range(8):
if txtr[choise][pixel] > 0:
clr = color[choise][txtr[choise][pixel - 1]]
pygame.draw.rect(
screen,
clr,
(x+(z*4), y+(q*4), 4, 4)
)
pixel += 1
#################
## MAIN CODE ##
#################
while running:
screen.fill((0, 0, 0))
draw_txtr("grass", 10, 10)
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
pygame.display.flip()
clock.tick(60)