Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function love.load()
- windowwidth = 1000
- windowheight = 1000
- sucess = love.window.setMode(windowwidth, windowheight)
- x = 30
- y = 50
- z = math.sin(math.pi/3)
- cx = 0
- cy = 0
- a = 20
- b = 1/4
- end
- function love.update(dt)
- if love.keyboard.isDown("up") then
- a = a*2*dt
- end
- if love.keyboard.isDown("down") then
- a = a/2*dt
- end
- if love.keyboard.isDown("left") then
- b = b*2*dt
- end
- if love.keyboard.isDown("right") then
- b = b/2*dt
- end
- end
- function love.draw() -- render to window
- love.graphics.setColor(200/255, 215/255, 0/255)
- delthe = math.pi/60 -- 3 degrees
- x = 0
- p = 1
- ps = 4 -- phase shift of 4
- odeg = math.pi/180
- for theta = -32*math.pi, 32*math.pi, odeg do
- love.graphics.line(x, a*math.sin(b*(theta))+windowwidth/2, x+odeg, a*math.sin(b*theta+odeg)+windowwidth/2)
- x = x + 0.1
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement