Advertisement
xerpi

Mapas

Dec 9th, 2011
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.86 KB | None | 0 0
  1. imagen = {w = 15,h=15}
  2.     imagen[1] = image.load(".png")
  3.     imagen[2] = image.load(".png")
  4.  
  5.  
  6. mapa = {x = 0,actual = 1}
  7.     mapa[1] = {
  8.                 {"1","2","2","2","2","2","2","2","2","2","2","1"},
  9.                 {"1","2","2","2","2","2","2","2","2","2","2","1"},
  10.                 {"1","2","2","2","2","2","2","2","2","2","2","1"},
  11.                 {"1","2","2","2","2","2","2","2","2","2","2","1"},
  12.                 {"1","2","2","2","2","2","2","2","2","2","2","1"},
  13.                 {"1","2","2","2","2","2","2","2","2","2","2","1"},
  14.                 {"1","2","2","2","2","2","2","2","2","2","2","1"},
  15.                 {"1","2","2","2","2","2","2","2","2","2","2","1"},
  16.                 {"1","1","1","1","1","1","1","1","1","1","1","1"}
  17.             }
  18.     mapa.y = -(#mapa[actual]*imagen.h)
  19.  
  20.  
  21.  
  22. function mapa.blit()
  23.     for y = 1, #mapa[actual] do
  24.         for x = 1, #mapa[actual][y] do
  25.             imagen[tonumber(mapa[actual][y][x])]:blit(mapa.x + (x-1)*imagen.w, mapa.y + (y-1)*imagen.h)
  26.         end
  27.     end
  28. end
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement