Advertisement
joseleeph

Untitled

May 9th, 2021
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 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. ra = 1
  24. end
  25.  
  26. function love.update(dt)
  27.  
  28. ctheta = ctheta - ra*math.pi/4*dt -- smaller angle = slower rotspeed
  29. gcxco = gcxco + 1*dt
  30. startposX = startposX + 1
  31. --ra = ra*1.01
  32. i = 0
  33.  
  34. while ctheta > ctheta - 6*math.pi do -- 3 rotations
  35. startposX = startposX + 1
  36. ra = ra*1.01
  37. end
  38. end
  39.  
  40. function love.draw()
  41. --love.graphics.push()
  42. love.graphics.translate(windowwidth/2, windowheight/2)
  43.  
  44. -- green circle
  45. love.graphics.setColor(0, 1, 0)
  46. cjrcle(discr, startposX, gcyco, 32)
  47.  
  48. --blue circle
  49. love.graphics.setColor(0, 0, 1) -- blue paint
  50. cjrcle(10, startposX + discr*math.cos(ctheta), y - discr*math.sin(ctheta), 16)
  51. --love.graphics.pop()
  52. end
  53.  
  54.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement