Advertisement
joseleeph

Untitled

May 12th, 2021
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 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. end
  24.  
  25. function love.update(dt)
  26. ctheta = ctheta - 2*math.pi*dt -- smaller angle = slower rotspeed
  27. gcxco = gcxco + 1*dt
  28. --if startposX < 0 then
  29. -- startposX = startposX + 1
  30. --end
  31. -- player will appear in center of screen... why?
  32. while startposX < 0 do
  33. if love.keyboard.isDown("space") then
  34. startposX = startposX
  35. else
  36. startposX = startposX + 1
  37. end
  38. end
  39.  
  40. --end
  41. --startposX = startposX + 1
  42. end
  43.  
  44. function love.draw()
  45. --love.graphics.push()
  46. love.graphics.translate(windowwidth/2, windowheight/2)
  47.  
  48. -- green circle
  49. love.graphics.setColor(0, 1, 0)
  50. cjrcle(discr, startposX, gcyco, 32)
  51.  
  52. --blue circle
  53. love.graphics.setColor(0, 0, 1) -- blue paint
  54. cjrcle(10, startposX + discr*math.cos(ctheta), y - discr*math.sin(ctheta), 16)
  55. --love.graphics.pop()
  56. end
  57.  
  58.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement