Posted By

mouseroot on 08/26/10


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

mouseroot


Draw Map Code


 / Published in: Python
 

Draws the Map Based on a x1 by x2 Array(List in Python)

  1. def RenderMap(scr,layer1,layer2,layer3,x1,y1):
  2. mapx = 0
  3. mapy = 0
  4. for x in range(x1):
  5. for y in range(y1):
  6. if mapx == 600:
  7. mapy += 50
  8. mapx = 0
  9.  
  10. if layer1[x][y] == 1:
  11. scr.blit(grass,(mapx,mapy))
  12. if layer1[x][y] == 0:
  13. scr.blit(water,(mapx,mapy))
  14. if layer1[x][y] == 2:
  15. scr.blit(dirt,(mapx,mapy))
  16.  
  17. if layer2[x][y] == 6:
  18. scr.blit(star,(mapx,mapy))
  19.  
  20.  
  21. mapx += 50

Report this snippet  

You need to login to post a comment.