SHARE
TWEET

Untitled

a guest Mar 26th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.   --[[
  2.   if pY-zoom < 1       then pY = zoom+1 end
  3.   if pY+zoom > #map    then pY = #map-zoom end
  4.   if pX+zoom > #map[1] then pX = #map[1]-zoom end
  5.   if pX-zoom < 1       then pX = zoom+1 end
  6.  
  7.   for y=pY - zoom, pY + zoom, 1 do
  8.     for x=pX - zoom, pX + zoom, 1 do
  9.       if x > 0 and x < #map[1]+1 and y > 0 and y <#map+1 then
  10.         if map[y][x] ~= 0 then
  11.           local cTile = tiles[map[y][x]]   --<== le soucis est ici!
  12.           local originX = (x-(pX)+zoom)*(width/(2*zoom+1))
  13.           local originY = (y-pY+zoom)*(height/(2*zoom+1))
  14.           local tileSizeX = (width/((2*zoom)+1))/ cTile:getWidth()
  15.           local tileSizeY = height/((2*zoom)+1)/ cTile:getHeight()
  16.           love.graphics.draw(cTile, originX,originY,0,tileSizeX , tileSizeY)
  17.         end
  18.       end
  19.     end
  20.   end
  21.  
  22.   --]]--
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top