So, I was making a simple 2D game in pygame, and was making the map (following a tutorial video, don't judge me, I'm new to pygame) and using replit.com, and that error showed up in the console.
here's my code for it:
import pygame, sys
W = 0
S = 1
G = 2
F = 3
BLUE = (0,0,255)
SAND = (194,176,128)
GRASS = (124,252,0)
FOREST = (0,100,0)
TileColor = {W : BLUE,
S : SAND,
G : GRASS,
F : FOREST
}
map1 = {(W, S, G, F, F, F, G, S, W, W, W, W),
[W, S, S, G, G, G, G, F, F, W, W, W],
[W, S, G, G, G, F, F, F, F, F, W, W],
[W, S, S, G, G, G, G, G, F, F, F, W]
}
TILESIZE = 40
MAPWIDTH = 12
MAPHEIGHT = 4
pygame.init()
DISPLAY = pygame.display.set_mode((MAPWIDTH * TILESIZE,MAPHEIGHT * TILESIZE))
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
for row in range(MAPHEIGHT):
for col in range(MAPWIDTH):
pygame.draw.rect(DISPLAY,TileColor[map1[row][col]],(col * TILESIZE,row * TILESIZE,TILESIZE,TILESIZE))
pygame.display.update
if anyone has any suggestions for changing my code, please say, and I am sticking with replit.com
