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
- rv = 1 -- roational velocity
- end
- function love.update(dt)
- ctheta = ctheta - rv*math.pi/4*dt -- smaller angle = slower rotspeed
- --startposX = startposX + 0.5
- if startposX < 500 then
- startposX = startposX + 0.5
- --else
- --startposX = startposX
- end
- if rv < 12 then
- rv = rv*1.01
- end
- --[[
- while rv < 10 and ctheta%2*math.pi do
- rv = ra*1.1
- end
- if rv < 12 then
- rv = rv*1.01
- end
- ]]
- --ra = ra*1.01
- --i = 0
- --[[
- while ctheta > ctheta - 6*math.pi do -- 3 rotations
- startposX = startposX + 1
- rv = rv*1.01
- end
- --[[
- while ctheta > ctheta - 6*math.pi do -- 3 rotations
- if rv < 12 then
- rv = rv*1.01
- startposX = startposX + 1
- rv = rv*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