Advertisement
Guest User

test_entitiy.lua

a guest
Mar 15th, 2014
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.08 KB | None | 0 0
  1. local model = testentitymodel
  2.  
  3. c = {}
  4.  
  5. function loadcircle()
  6.   cor = {}
  7.   for i = 1,6,2 do
  8. --    local x = math.random( 1, 400 )
  9. --    local y = math.random( 1, 400 )
  10.     cor[i] = math.random( 1, 400 )
  11.     cor[i + 1] = math.random( 1, 400 )
  12.    
  13. --    table.insert( cor, )
  14.   end
  15.  
  16.   for i = 1,#cor do
  17.     table.insert( c, cor[ i ] )
  18.   end
  19. end
  20.  
  21. function drawcircle()
  22.   love.graphics.setColor( 16, 16, 255 )
  23.  
  24.   for i = 1,#c,2 do
  25.     love.graphics.circle( "fill", c[ i ], c[ i+1 ], 10, 100 )
  26.   end
  27. end
  28.  
  29. function circlecheck()
  30.   for i = 1,#c,2 do
  31.   cix = c[ i ]
  32.   ciy = c[ i+1 ]
  33.  
  34.   print( cix )
  35.   print( ciy )
  36.  
  37.     if px >= c[ i ] - 25 and px <= c[ i ] + 25 and py >= ciy - 25 and py <= ciy + 25 then
  38.       if mx >= c[ i ] - 10 and mx <= c[ i ] + 10 and my >= ciy - 10 and my <= ciy + 10 then
  39.         print( "yes" )
  40.         table.remove( c, i + 1 )
  41.         table.remove( c, i )
  42.       end
  43.     end
  44.   end
  45. end
  46.  
  47. function listcircles()
  48.   for i,v in ipairs( cor ) do
  49.     print( i, v )
  50.   end
  51.  
  52.   if #cor == 0 then
  53.     print ( "yep, she's empty" )
  54.   end
  55. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement