Advertisement
Guest User

1line love2d main.lua

a guest
Nov 27th, 2016
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.66 KB | None | 0 0
  1. function love.load()
  2.     love.window.setMode(0, 0, {fullscreen = true, fullscreentype = "exclusive"})
  3.     scr_width, scr_height = love.window.getMode()
  4.     love.mouse.setVisible(false)
  5.  
  6.     thickness = 1
  7.     where = love.mouse.getY()
  8.    
  9.     love.graphics.setColor(255,255,255)
  10. end
  11.  
  12. function love.update()
  13.     where = love.mouse.getY()
  14.     if where + thickness > scr_height then
  15.         where = scr_height - thickness
  16.     end
  17. end
  18.  
  19. function love.draw()
  20.     love.graphics.rectangle("fill", 0, where, scr_width, thickness)
  21. end
  22.  
  23. function love.wheelmoved(x, y)
  24.     thickness = thickness + y
  25.     if thickness < 0 then
  26.         thickness = 0
  27.     end
  28. end
  29.  
  30. function love.mousepressed()
  31.     love.event.quit()
  32. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement