Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function love.load()
- --Object = require "classic"
- require "cjrcle"
- windowwidth = 1000
- windowheight = 1000
- sucess = love.window.setMode(windowwidth, windowheight) -- what does this line do? ... will work but the circle is offset
- ctheta = math.pi/2
- x = 0
- y = 0
- gcxco = -500
- gcyco = 0
- startposX = - 500
- cxpos = 100*math.cos(ctheta)
- cypos = 100*math.sin(ctheta)
- discr = 50
- hr = 10
- ra = 1
- end
- function love.update(dt)
- ctheta = ctheta - ra*math.pi/4*dt -- smaller angle = slower rotspeed
- gcxco = gcxco + 1*dt
- startposX = startposX + 1
- --ra = ra*1.01
- i = 0
- while ctheta > ctheta - 6*math.pi do -- 3 rotations
- startposX = startposX + 1
- ra = ra*1.01
- end
- end
- function love.draw()
- --love.graphics.push()
- love.graphics.translate(windowwidth/2, windowheight/2)
- -- green circle
- love.graphics.setColor(0, 1, 0)
- cjrcle(discr, startposX, gcyco, 32)
- --blue circle
- love.graphics.setColor(0, 0, 1) -- blue paint
- cjrcle(10, startposX + discr*math.cos(ctheta), y - discr*math.sin(ctheta), 16)
- --love.graphics.pop()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement