/ Published in: Python
Draws the Map Based on a x1 by x2 Array(List in Python)
Expand |
Embed | Plain Text
def RenderMap(scr,layer1,layer2,layer3,x1,y1): mapx = 0 mapy = 0 for x in range(x1): for y in range(y1): if mapx == 600: mapy += 50 mapx = 0 if layer1[x][y] == 1: scr.blit(grass,(mapx,mapy)) if layer1[x][y] == 0: scr.blit(water,(mapx,mapy)) if layer1[x][y] == 2: scr.blit(dirt,(mapx,mapy)) if layer2[x][y] == 6: scr.blit(star,(mapx,mapy)) mapx += 50
You need to login to post a comment.
