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
- --cjrcle.x = cjrcle.x + math.cos(ctheta + math.pi/60*dt)
- --cjrcle.y = cjrcle.y + math.sin(ctheta + math.pi/60*dt) -- THESE LINES CAUSE AN ERROR!
- circle = { -- properties cjrcle() objects
- xpos = 0,
- ypos = 0,
- radius = 100,
- image = cjrcle(100, x, y, 32),
- speed = 100
- }
- end
- function love.update(dt)
- x = 0
- y = 0
- theta = math.pi/2
- cjrcle.xpos = cjrcle.xpos + math.cos(ctheta + math.pi/60*dt)
- cjrcle.ypos = cjrcle.ypos + math.sin(ctheta + math.pi/60*dt)
- theta = theta + math.pi/60
- end
- function love.draw()
- --love.graphics.push()
- love.graphics.translate(windowwidth/2, windowheight/2)
- x = 0
- y = 0
- local segs = 64
- local ctheta = math.pi/2
- love.graphics.setColor(1, 0, 0)
- love.graphics.setColor(0, 1, 0) -- green circle
- cjrcle(100, x, y, 32)
- love.graphics.setColor(0, 0, 0)-- black line
- love.graphics.line(100*math.cos(math.pi/2), 100*math.sin(math.pi/2), 100*math.cos(-math.pi/2), 100*math.sin(-math.pi/2))
- --blue circle
- love.graphics.setColor(0, 0, 1) -- blue paint
- love.graphics.circle("fill", x + 100*math.cos(ctheta), y - 100*math.sin(ctheta), 10)
- love.graphics.setColor(1, 1, 0) -- yellow paint
- cjrcle(10, 100*math.cos(theta), -100*math.sin(theta), 16)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement