joseleeph

Untitled

Apr 20th, 2021
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1.  
  2. function love.load() -- do global variables get declared here?
  3. windowwidth = 1000
  4. windowheight = 1000
  5. sucess = love.window.setMode(windowwidth, windowheight)
  6. end
  7.  
  8. function plot(x, Xmin, Xmax, Ymin, Ymax)
  9. for i = Xmin, Xmax do
  10. love.graphics.line(i, -i^2, i+1, -(i+1)^2)
  11. end
  12. end
  13.  
  14.  
  15. function love.draw()
  16.  
  17. ox = windowwidth/2
  18. oy = windowheight/2
  19. x = -windowwidth
  20. yh = windowheight
  21. ww = windowwidth
  22. orgx = ww/2
  23. orgy = yh
  24. nx = orgx
  25. ny = orgy
  26.  
  27. love.graphics.setColor(200/255, 215/255, 0/255)
  28.  
  29.  
  30. love.graphics.translate(windowwidth/2, windowheight/2)
  31. love.graphics.scale(2,2)
  32. plot(2, -10, 10, -10, 10)
  33.  
  34. end
Add Comment
Please, Sign In to add comment