Advertisement
Guest User

Untitled

a guest
Apr 1st, 2020
1,355
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 22.25 KB | None | 0 0
  1. (dump)
  2.  
  3. local depth = 0
  4. local function tablelength(t)
  5.     count=0
  6.     for k, v in pairs(t) do
  7.         count=count+1
  8.     end
  9.     return count
  10. end
  11. function dump2(o, i)
  12.     depth=depth+1
  13.     if depth==1 then i=true end
  14.     if type(o) == 'table' then
  15.         local s = "\n" .. string.rep('  ', depth-1) .. '{ \n'
  16.         local count=0
  17.         for k,v in pairs(o) do
  18.             u=false
  19.             count=count+1
  20.             if count==tablelength(o) then u=true end
  21.             if type(k) ~= 'number' then k = '"'..k..'"' end
  22.             s = s .. string.rep('   ', depth) .. '['..k..'] = ' .. dump2(v, u) .. '\n'
  23.         end
  24.         depth=depth-1
  25.         l = s .. string.rep('   ', depth) .. '}'
  26.         if not i then l=l..', ' end
  27.         return l
  28.     else
  29.         depth=depth-1
  30.         l=tostring(o)
  31.         if not i then l=l..',' end
  32.         return l
  33.     end
  34. end
  35. function dump(...)
  36.     print(dump2(...))
  37. end
  38.  
  39.  
  40.  
  41. (class)
  42. Class={}
  43. function Class:new(args)
  44.     o={}
  45.     if self.init then o=self.init(o, args) end
  46.     self.__index=self
  47.     setmetatable(o, self)
  48.     return o
  49. end
  50. function Class:destroy(args)
  51.     if self.dest then self:dest(args) end
  52.     self=nil
  53. end
  54. function Class:toTable(args)
  55.     local t = {}
  56.     for k, v in pairs(self) do
  57.         t[k]=v
  58.     end
  59.     if self.totab then t=self.totab(t, args) end
  60.     return t
  61. end
  62.  
  63. function Class:getSuperclass()
  64.     return getmetatable(self)
  65. end
  66. function Class:setSuperclass(t)
  67.     setmetatable(self, t)
  68. end
  69. function Class:copy()
  70.     local t = {}
  71.     for k, v in pairs(self) do
  72.         t[k]=v
  73.     end
  74.     setmetatable(t, getmetatable(self))
  75.     return t
  76. end
  77.  
  78.  
  79. --]]
  80. function love.load()
  81.     require('class')
  82.     require('dump')
  83.     print(love.getVersion())
  84.     math.randomseed(os.time())
  85.     Instance=Class:new()
  86.     function Instance.init(o, args)
  87.         local parent
  88.         local children
  89.         if args then
  90.             if args.parent then parent=args.parent end
  91.             if args.children then children=args.children else children= {} end
  92.             if parent then if parent.init then o=parent.init(o, args) end end
  93.         else
  94.             children={}
  95.         end
  96.  
  97.         local instance={['children']=children, ['parent']=parent}
  98.         function o:getChildren()
  99.             return instance.children
  100.         end
  101.         function o:getChild(name)
  102.             if instance.children[name] then return instance.children[name] else error('Unknown Child') end
  103.         end
  104.         function o:getParent()
  105.             if instance.parent then return instance.Parent end
  106.         end
  107.         function o:switchParent(parent)
  108.             instance.parent = parent
  109.         end
  110.         function o:addChild(child)
  111.             child:switchParent(self)
  112.         end
  113.         function o.dest()
  114.             for k, v in pairs(instance.children) do
  115.                 v:Destroy()
  116.             end
  117.         end
  118.         return o
  119.     end
  120.     Tile=Instance:new()
  121.     function Tile.init(o, args)
  122.         o=Instance.init(o, args)
  123.         o.x=args.x
  124.         o.y=args.y
  125.         o.img=args.img
  126.         o.quad=args.quad
  127.         return o
  128.     end
  129.     Layer=Instance:new()
  130.     Layers={}
  131.     function distance(a, b)
  132.         return math.sqrt(math.pow(math.abs(a.x-b.x), 2)+math.pow(math.abs(a.y-b.y), 2))
  133.     end
  134.     function genWorleyTable(width, height, numPoints)
  135.         local grid={}
  136.         local scaleGrid={}
  137.         for x=1, width*3 do
  138.             scaleGrid[x]={}
  139.             for y=1, height*3 do
  140.                 if os.clock()>=currtime2+frame then currtime2=os.clock() msg='Creating Worley Table' percent=(((x-1)*height*3)+y)/(width*3*height*3) coroutine.yield() end
  141.                 scaleGrid[x][y]=0
  142.             end
  143.         end
  144.         local pts={}
  145.         local points={}
  146.         for t=1, numPoints do
  147.             if os.clock()>=currtime2+frame then currtime2=os.clock() msg='Creating Worley Table Points' percent=t/numPoints coroutine.yield() end
  148.             table.insert(pts, {['x']=math.random(0, width-1), ['y']=math.random(0, height-1)})
  149.         end
  150.         for a=1, 3 do
  151.             for b=1, 3 do
  152.                 for k, v in pairs(pts) do
  153.                     if os.clock()>=currtime2+frame then currtime2=os.clock() msg='Duplicating Worley Table Points' percent=(((a-1)*3*numPoints)+((b-1)*numPoints)+k)/(9*numPoints) coroutine.yield() end
  154.                     table.insert(points, {['x']=(a-1)*width+v.x, ['y']=(b-1)*height+v.y})
  155.                 end
  156.             end
  157.         end
  158.         for k, v in pairs(scaleGrid) do
  159.             for p, t in pairs(v) do
  160.                 local y=height*3*width*3
  161.                 if os.clock()>=currtime2+frame then currtime2=os.clock() msg='Creating Worley Noise' percent=((k*#v)+p)/(#scaleGrid*#v) coroutine.yield() end
  162.                 for i, o in pairs(points) do
  163.                     y=math.min(y, distance(o, {['x']=k, ['y']=p}))
  164.                 end
  165.                 scaleGrid[k][p]=y
  166.             end
  167.         end
  168.         for x=1, width do
  169.             grid[x]={}
  170.             for y=1, height do
  171.                 if os.clock()>=currtime2+frame then currtime2=os.clock() msg='Duplicating Worley Noise' percent=((x-1)*height)+y/width*height coroutine.yield() end
  172.                 grid[x][y]=scaleGrid[x+width][y+height]
  173.             end
  174.         end
  175.         return grid, scaleGrid
  176.     end
  177.     function Layer.init(o, args)
  178.         o=Instance.init(o, args)
  179.         o.x=args.x
  180.         o.y=args.y
  181.         o.tx=args.tx
  182.         o.ty=args.ty
  183.         o.tiles={}
  184.         for x=1, o.x do
  185.             o.tiles[x]={}
  186.             for y=1, o.y do
  187.                 o.tiles[x][y]=Tile:new({}, {['x']=o.tx, ['y']=o.ty})
  188.                 o:addChild(o.tiles[x][y])
  189.             end
  190.         end
  191.         table.insert(Layers, o)
  192.         return o
  193.     end
  194.     local success=love.window.setMode(0, 0, {fullscreen=true})
  195.     cloudFile=love.graphics.newImage('clouds.png')
  196.     platformFile=love.graphics.newImage('tileset.png')
  197.     platformQuads={}
  198.     pq=platformQuads
  199.     cloudQuads={}
  200.     cq=cloudQuads
  201.     for x=1, 9 do
  202.         for y=1, 9 do
  203.             table.insert(platformQuads, love.graphics.newQuad((x-1)*16+x, (y-1)*16+y, 16, 16, platformFile:getDimensions()))
  204.         end
  205.     end
  206.     for x=1, 9 do
  207.         for y=1, 10 do
  208.             table.insert(cloudQuads, love.graphics.newQuad((x-1)*16+x, (y-1)*16+y, 16, 16, cloudFile:getDimensions()))
  209.         end
  210.     end
  211.     width, height = love.graphics.getDimensions()
  212.     function cloudType(x, y, layer)
  213.         local u, d, l, r, ul, ur, dl, dr
  214.         if y~=1 then u=layer[x][y-1] else u=layer[x][math.ceil(height/16)] end
  215.         if y~=math.ceil(height/16) then d=layer[x][y+1] else d=layer[x][1] end
  216.         if x~=1 then l=layer[x-1][y] else l=layer[math.ceil(width/16)][y] end
  217.         if x~=math.ceil(width/16) then r=layer[x+1][y] else r=layer[1][y] end
  218.         if y ~= 1 then
  219.             if x ~= 1 then
  220.                 ul=layer[x - 1][y - 1]
  221.             else
  222.                 ul=layer[math.ceil(width / 16)][y - 1]
  223.             end
  224.         else
  225.             if x ~= 1 then
  226.                 ul=layer[x - 1][math.ceil(height / 16)]
  227.             else
  228.                 ul=layer[math.ceil(width / 16)][math.ceil(height / 16)]
  229.             end
  230.         end
  231.         if y ~= math.ceil(height / 16) then
  232.             if x ~= 1 then
  233.                 dl=layer[x - 1][y + 1]
  234.             else
  235.                 dl=layer[math.ceil(width / 16)][y + 1]
  236.             end
  237.         else
  238.             if x ~= 1 then
  239.                 dl=layer[x - 1][1]
  240.             else
  241.                 dl=layer[math.ceil(width / 16)][1]
  242.             end
  243.         end
  244.         if y ~= 1 then
  245.             if x ~= math.ceil(width / 16) then
  246.                 ur=layer[x + 1][y - 1]
  247.             else
  248.                 ur=layer[1][y - 1]
  249.             end
  250.         else
  251.             if x ~= math.ceil(width / 16) then
  252.                 ur=layer[x + 1][math.ceil(height / 16)]
  253.             else
  254.                 ur=layer[1][math.ceil(height / 16)]
  255.             end
  256.         end
  257.         if y ~= math.ceil(height / 16) then
  258.             if x ~= math.ceil(width / 16) then
  259.                 dr=layer[x + 1][y + 1]
  260.             else
  261.                 dr=layer[1][y + 1]
  262.             end
  263.         else
  264.             if x ~= math.ceil(width / 16) then
  265.                 dr=layer[x + 1][1]
  266.             else
  267.                 dr=layer[1][1]
  268.             end
  269.         end
  270.         return u, d, l, r, ul, ur, dl, dr
  271.     end
  272.     function CloudType(x, y, layer)
  273.         local u, d, l, r, ul, ur, dl, dr = cloudType(x, y, layer)
  274.         if not u and not l and not d and not r then
  275.             return cq[81]
  276.         else
  277.             if u and not l and not d and not r then
  278.                 return cq[42]
  279.             elseif not u and l and not d and not r then
  280.                 return cq[43]
  281.             elseif not u and not l and d and not r then
  282.                 return cq[41]
  283.             elseif not u and not l and not r and l then
  284.                 return cq[44]
  285.             elseif u and l and not d and not r then
  286.                 if ul then
  287.                     local t=math.random(1, 4)
  288.                     if t==1 then return cq[12] elseif t==2 then return cq[16] elseif t==3 then return cq[32] else return cq[34] end
  289.                 else
  290.                     return cq[58]
  291.                 end
  292.             elseif u and r and not d and not l then
  293.                 if ur then
  294.                     local t=math.random(1, 4)
  295.                     if t==1 then return cq[2] elseif t==2 then return cq[6] elseif t==3 then return cq[22] else return cq[24] end
  296.                 else
  297.                     return cq[59]
  298.                 end
  299.             elseif d and l and not u and not r then
  300.                 if dl then
  301.                     local t=math.random(1, 4)
  302.                     if t==1 then return cq[11] elseif t==2 then return cq[15] elseif t==3 then return cq[31] else return cq[33] end
  303.                 else
  304.                     return cq[57]
  305.                 end
  306.             elseif d and r and not u and not l then
  307.                 if dr then
  308.                     local t=math.random(1, 4)
  309.                     if t==1 then return cq[1] elseif t==2 then return cq[5] elseif t==3 then return cq[21] else return cq[23] end
  310.                 else
  311.                     return cq[60]
  312.                 end
  313.             elseif u and d and not l and not r then
  314.                 local t=math.random(1, 2)
  315.                 if t==1 then return cq[46] else return cq[56] end
  316.             elseif l and r and not u and not d then
  317.                 local t=math.random(1, 2)
  318.                 if t==1 then return cq[45] else return cq[55] end
  319.             elseif l and r and u and not d then
  320.                 if not ul and not ur then
  321.                     return cq[61]
  322.                 elseif ul and not ur then
  323.                     return cq[65]
  324.                 elseif not ul and ur then
  325.                     return cq[63]
  326.                 else
  327.                     local t=math.random(1, 4)
  328.                     if t==1 then return cq[20] elseif t==2 then return cq[36] elseif t==3 then return cq[38] else return cq[40] end
  329.                 end
  330.             elseif l and r and d and not u then
  331.                 if not dl and not dr then
  332.                     return cq[62]
  333.                 elseif dl and not dr then
  334.                     return cq[74]
  335.                 elseif not dl and dr then
  336.                     return cq[76]
  337.                 else
  338.                     local t=math.random(1, 4)
  339.                     if t==1 then return cq[9] elseif t==2 then return cq[25] elseif t==3 then return cq[27] else return cq[29] end
  340.                 end
  341.             elseif u and d and l and not r then
  342.                 if not ul and not dl then
  343.                     return cq[71]
  344.                 elseif ul and not dl then
  345.                     return cq[64]
  346.                 elseif not ul and dl then
  347.                     return cq[66]
  348.                 else
  349.                     local t=math.random(1, 4)
  350.                     if t==1 then return cq[19] elseif t==2 then return cq[35] elseif t==3 then return cq[37] else return cq[39] end
  351.                 end
  352.             elseif u and d and r and not l then
  353.                 if not ur and not dr then
  354.                     return cq[72]
  355.                 end
  356.                 if ur and not dr then
  357.                     return cq[75]
  358.                 end
  359.                 if not ur and dr then
  360.                     return cq[73]
  361.                 end
  362.                 if ur and dr then
  363.                     local t=math.random(1, 4)
  364.                     if t==1 then return cq[10] elseif t==2 then return cq[26] elseif t==3 then return cq[28] else return cq[30] end
  365.                 end
  366.             elseif u and d and r and l then
  367.                 if not ur and not ul and not dl and not dr then
  368.                     local t=math.random(1, 4)
  369.                     if t==1 then return cq[67] elseif t==2 then return cq[68] elseif t==3 then return cq[77] else return cq[78] end
  370.                 elseif ur and not ul and not dr and not dl then
  371.                     return cq[52]
  372.                 elseif not ur and ul and not dr and not dl then
  373.                     return cq[51]
  374.                 elseif not ur and not ul and dr and not dl then
  375.                     return cq[53]
  376.                 elseif not ur and not ul and not dr and dl then
  377.                     return cq[54]
  378.                 elseif ur and ul and not dr and not dl then
  379.                     return cq[50]
  380.                 elseif ur and not ul and dr and not dl then
  381.                     return cq[49]
  382.                 elseif not ur and not ul and dr and dl then
  383.                     return cq[47]
  384.                 elseif not ur and ul and not dr and dl then
  385.                     return cq[48]
  386.                 elseif not ur and ul and dr and not dl then
  387.                     return cq[82]
  388.                 elseif ur and not ul and not dr and dl then
  389.                     return cq[83]
  390.                 elseif ur and ul and dr and not dl then
  391.                     return cq[8]
  392.                 elseif ur and ul and not dr and dl then
  393.                     return cq[18]
  394.                 elseif ur and not ul and dr and dl then
  395.                     return cq[7]
  396.                 elseif not ur and ul and dr and dl then
  397.                     return cq[17]
  398.                 elseif ur and ul and dr and dl then
  399.                     local t=math.random(1, 4)
  400.                     if t==1 then return cq[3] elseif t==2 then return cq[4] elseif t==3 then return cq[13] else return cq[14] end
  401.                 end
  402.             end
  403.         end
  404.         return cq[81]
  405.     end
  406.     yoffset=0
  407.     yoffset2=0
  408.     xoffset=0
  409.     xoffset2=0
  410.     yspeed=(math.random()-0.5)*2
  411.     xspeed=(math.random()-0.5)*2
  412.     frame=1/60
  413.     currtime=os.time()
  414.     currtime2=os.clock()
  415.     msg=''
  416.     percent=0
  417.     fps=0
  418.     fps2=0
  419.     firstCo=coroutine.create(function () Layer1=Layer:new({['x']=math.ceil(width/16), ['y']=math.ceil(height/16), ['tx']=16, ['ty']=16})
  420.         for x, v in pairs(Layer1.tiles) do
  421.             for y, t in pairs(v) do
  422.                 if os.clock()>=currtime2+frame then currtime2=os.clock() msg='Creating Background Tiles' percent=(((x-1)*#v)+y)/(#Layer1.tiles*#v) coroutine.yield() end
  423.                 t.img=cloudFile
  424.                 t.quad=cq[math.random(84, 90)]
  425.             end
  426.         end
  427.         Layer2= Layer:new({ ['x'] = math.ceil(width / 16), ['y'] = math.ceil(height / 16), ['tx'] = 16, ['ty'] = 16 })
  428.         Layer2b=genWorleyTable(math.ceil(width/16), math.ceil(height/16), (width/32*2+height/32*2))
  429.         Layer2c={}
  430.         for x, v in pairs(Layer2b) do
  431.             Layer2c[x]={}
  432.             for y, t in pairs(v) do
  433.                 Layer2.tiles[x][y].img=cloudFile
  434.                 if os.clock()>=currtime2+frame then currtime2=os.clock() msg='Creating Boolean Table from Worley Noise' percent=(((x-1)*#v)+y)/(#Layer2b*#v) coroutine.yield() end
  435.                 if t>5 then
  436.                     if t==6 then
  437.                         if math.random(1, 10)==1 then Layer2c[x][y]=true
  438.                         else Layer2c[x][y]=false end
  439.                     else Layer2c[x][y]=false end
  440.                 else Layer2c[x][y]=true end
  441.             end
  442.         end
  443.         for x, v in pairs(Layer2b) do
  444.             for y, t in pairs(v) do
  445.                 if os.clock()>=currtime2+frame then currtime2=os.clock() msg='Smoothing Clouds' percent=(((x-1)*#v)+y)/(#Layer2b*#v) coroutine.yield() end
  446.                 if Layer2c[x][y] then Layer2.tiles[x][y].quad=CloudType(x, y, Layer2c) else Layer2.tiles[x][y].quad=cq[81] end
  447.             end
  448.         end
  449.         --[[
  450.         Layer3=Layer:new({ ['x'] = math.ceil(width / 16)*3, ['y'] = math.ceil(height / 16)*3, ['tx'] = 16, ['ty'] = 16 })
  451.         for x=1, 3 do
  452.             for y=1, 3 do
  453.                 for x1=1, math.ceil(width/16) do
  454.                     for y1=1, math.ceil(height/16) do
  455.                         if os.clock()>=currtime2+frame then currtime2=os.clock() msg='Duplicating Cloud Table' percent=(((x-1)*3*math.ceil(width/16)*math.ceil(height/16))+((y-1)*math.ceil(width/16)*math.ceil(height/16))+((x1-1)*math.ceil(height/16))+y1)/(9*math.ceil(width/16)*math.ceil(height/16)) coroutine.yield() end
  456.                         Layer3.tiles[x1+math.ceil(width/16)*(x-1)][y1+math.ceil(height/16)*(y-1)]=Layer2.tiles[x1][y1]
  457.                     end
  458.                 end
  459.             end
  460.         end
  461.         --]]
  462.         --[[
  463.         Layer4=Layer:new({ ['x'] = math.ceil(width / 16)*3^2, ['y'] = math.ceil(height / 16)*3^2, ['tx'] = 16, ['ty'] = 16 })
  464.         for x=1, 3 do
  465.             for y=1, 3 do
  466.                 for x1=1, math.ceil(width/16)*3 do
  467.                     for y1=1, math.ceil(height/16)*3 do
  468.                         Layer4.tiles[x1+math.ceil(width/16)*(x-1)*3][y1+math.ceil(height/16)*3*(y-1)]=Layer3.tiles[x1][y1]
  469.                     end
  470.                 end
  471.             end
  472.         end
  473.         ]]--
  474.         love.graphics.setColor(1, 1, 1, 1)
  475.         skyCanvas=love.graphics.newCanvas()
  476.         love.graphics.setCanvas(skyCanvas)
  477.         love.graphics.clear()
  478.         love.graphics.setBlendMode("alpha")
  479.  
  480.         for k, v in pairs(Layers) do
  481.             if k~=2 and k~=3 and k~=4 then
  482.                 if type(v)~='function' then
  483.                     for u, x in pairs(v.tiles) do
  484.                         for i, y in pairs(x) do
  485.                            --if os.clock()>=currtime2+frame then currtime2=os.clock() msg='Generating Sky Picture' percent=(((u-1)*#x)+i)/(#v.tiles*#x) coroutine.yield() end
  486.                             love.graphics.setCanvas(skyCanvas)
  487.                             love.graphics.setColor(1, 1, 1, 1)
  488.                             love.graphics.draw(y.img, y.quad, v.tx*(u-1), v.ty*(i-1))
  489.                         end
  490.                     end
  491.                 end
  492.             end
  493.         end
  494.         coroutine.yield()
  495.         love.graphics.setColor(1, 1, 1, 1)
  496.         cloudCanvas=love.graphics.newCanvas()
  497.         love.graphics.setCanvas(cloudCanvas)
  498.         love.graphics.clear()
  499.         love.graphics.setBlendMode("alpha")
  500.         for u, x in pairs(Layer2.tiles) do
  501.             for i, y in pairs(x) do
  502.                 --if os.clock()>=currtime2+frame then currtime2=os.clock() msg='Generating Cloud Picture' percent=(((u-1)*#x)+i)/(#Layer3.tiles*#x) coroutine.yield() end
  503.                 love.graphics.setCanvas(cloudCanvas)
  504.                 love.graphics.setColor(1, 1, 1, 1)
  505.                 love.graphics.draw(y.img, y.quad, Layer2.tx*(u-1), Layer2.ty*(i-1))
  506.             end
  507.         end
  508.         coroutine.yield()
  509.         love.graphics.setCanvas()
  510.         t=cloudCanvas:newImageData()
  511.         cloudCanvas2=love.graphics.newImage(t)
  512.         print('finally finshed', t, cloudCanvas2)
  513.         coroutine.yield('finished')
  514.     end)
  515. end
  516. function love.update()
  517.     if coroutine.status(firstCo)=='suspended' or coroutine.status(firstCo)=='running' then
  518.         coroutine.resume(firstCo)
  519.     else
  520.         yoffset=yoffset+yspeed
  521.         yoffset=yoffset+yspeed*2
  522.         xoffset=xoffset+xspeed
  523.         xoffset2=xoffset2+xspeed*2
  524.         if yoffset>height then yoffset=yoffset-height end
  525.         if yoffset<-height then yoffset=yoffset+height end
  526.         if xoffset>width then xoffset=xoffset-width end
  527.         if xoffset<-width then xoffset=xoffset+width end
  528.         if yoffset2>height then yoffset2=yoffset2-height end
  529.         if yoffset2<-height then yoffset2=yoffset2+height end
  530.         if xoffset2>width then xoffset2=xoffset2-width end
  531.         if xoffset2<-width then xoffset2=xoffset2+width end
  532.     end
  533. end
  534. function love.draw()
  535.     love.graphics.setCanvas()
  536.     if coroutine.status(firstCo)=='suspended' or coroutine.status(firstCo)=='running' then
  537.         love.graphics.setCanvas()
  538.         love.graphics.print(msg..' ' .. percent*100 .. '%')
  539.         love.graphics.setColor(1, 1, 1, 1)
  540.     else
  541.         --[[ PARALAX MAPPING [HIGHLY LAGGY]
  542.         for u, x in pairs(Layer4.tiles) do
  543.             for i, y in pairs(x) do
  544.                 love.graphics.draw(y.img,
  545.                         y.quad,
  546.                         Layer4.tx/2*(u-math.ceil(width/8) -1)+xoffset2,
  547.                         Layer4.ty/2*(i-math.ceil(height/8)-1)+yoffset2, 0, 0.5, 0.5)
  548.             end
  549.         end
  550.         ]]--
  551.         love.graphics.setColor(1, 1, 1, 1)
  552.         love.graphics.setCanvas()
  553.         love.graphics.setBlendMode('alpha')
  554.         love.graphics.draw(skyCanvas)
  555.         love.graphics.draw(cloudCanvas, width/2, height/2)
  556.         love.graphics.draw(cloudCanvas2, -width/2, -height/2)
  557.         --[[
  558.         love.graphics.draw(cloudCanvas2, xoffset, yoffset)
  559.         love.graphics.draw(cloudCanvas2, xoffset, yoffset+height)
  560.         love.graphics.draw(cloudCanvas2, xoffset, yoffset-height)
  561.         love.graphics.draw(cloudCanvas2, xoffset+width, yoffset)
  562.         love.graphics.draw(cloudCanvas2, xoffset+width, yoffset+height)
  563.         love.graphics.draw(cloudCanvas2, xoffset+width, yoffset-height)
  564.         love.graphics.draw(cloudCanvas2, xoffset-width, yoffset)
  565.         love.graphics.draw(cloudCanvas2, xoffset-width, yoffset+height)
  566.         love.graphics.draw(cloudCanvas2, xoffset-width, yoffset-height)
  567.         --]]
  568.         if currtime==os.time() then fps=fps+1 else fps2=fps fps=0 currtime=os.time() end
  569.         love.graphics.setBlendMode('alpha')
  570.         love.graphics.setColor(1, 0, 0, 1)
  571.         love.graphics.print('FPS '..fps2)
  572.         love.graphics.setColor(1, 1, 1, 1)
  573.     end
  574. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement