Advertisement
joseleeph

Untitled

May 10th, 2021
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1.  
  2. function love.load()
  3. --Object = require "classic"
  4. require "cjrcle"
  5. windowwidth = 1000
  6. windowheight = 1000
  7. sucess = love.window.setMode(windowwidth, windowheight) -- what does this line do? ... will work but the circle is offset
  8.  
  9. ctheta = math.pi/2
  10. x = 0
  11. y = 0
  12.  
  13. gcxco = -500
  14. gcyco = 0
  15.  
  16. startposX = - 500
  17.  
  18. cxpos = 100*math.cos(ctheta)
  19. cypos = 100*math.sin(ctheta)
  20.  
  21. discr = 50
  22. hr = 10
  23. rv = 1 -- roational velocity
  24. end
  25.  
  26. function love.update(dt)
  27.  
  28. ctheta = ctheta - rv*math.pi/4*dt -- smaller angle = slower rotspeed
  29.  
  30. --startposX = startposX + 0.5
  31. if startposX < 500 then
  32. startposX = startposX + 0.5
  33. --else
  34. --startposX = startposX
  35. end
  36.  
  37. if rv < 12 then
  38. rv = rv*1.01
  39. end
  40.  
  41.  
  42.  
  43.  
  44. --[[
  45. while rv < 10 and ctheta%2*math.pi do
  46. rv = ra*1.1
  47. end
  48.  
  49. if rv < 12 then
  50. rv = rv*1.01
  51. end
  52. ]]
  53.  
  54. --ra = ra*1.01
  55. --i = 0
  56. --[[
  57. while ctheta > ctheta - 6*math.pi do -- 3 rotations
  58. startposX = startposX + 1
  59. rv = rv*1.01
  60. end
  61.  
  62. --[[
  63.  
  64. while ctheta > ctheta - 6*math.pi do -- 3 rotations
  65. if rv < 12 then
  66. rv = rv*1.01
  67. startposX = startposX + 1
  68. rv = rv*1.01
  69. end
  70. ]]
  71. end
  72.  
  73. function love.draw()
  74. --love.graphics.push()
  75. love.graphics.translate(windowwidth/2, windowheight/2)
  76.  
  77. -- green circle
  78. love.graphics.setColor(0, 1, 0)
  79. cjrcle(discr, startposX, gcyco, 32)
  80.  
  81. --blue circle
  82. love.graphics.setColor(0, 0, 1) -- blue paint
  83. cjrcle(10, startposX + discr*math.cos(ctheta), y - discr*math.sin(ctheta), 16)
  84. --love.graphics.pop()
  85. end
  86.  
  87.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement