Advertisement
Guest User

main.lua

a guest
Mar 15th, 2014
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.73 KB | None | 0 0
  1. function love.draw()
  2.   if gamestate == "menu" then
  3.     sbutx = 200
  4.     sbuty = 500
  5.    
  6.     love.graphics.setColor( 64, 64, 64 )
  7.     love.graphics.rectangle( "fill", 0, 0, 999, 999 )
  8.    
  9.     love.graphics.setColor( 25, 212, 206 )
  10.     love.graphics.print( "A game!", 0, 0, 0, 2, 2 )
  11.    
  12.     love.graphics.setColor( 159, 105, 201 )
  13.     love.graphics.rectangle( "fill", sbutx, sbuty, 400, 50 )
  14.    
  15.     love.graphics.setColor( 0, 0, 0 )
  16.     love.graphics.print( "start", 360, 510, 0, 2, 2 )
  17.   end
  18.  
  19.   if gamestate == "playing" and pause == false then
  20.     drawcircle()
  21.     drawplayer()
  22.     drawhp()
  23.     drawchathist()
  24.    
  25.     if chatting == true then
  26.       chat.drawbox()
  27.       love.graphics.printf( text, 0, 500, 800 )
  28.     end
  29.    
  30.     if helpmenu == true then
  31.       drawhelp()
  32.       drawhp()
  33.     end
  34.    
  35.   elseif gamestate == "playing" and pause == true then
  36.     pausegame()
  37.   end
  38.    
  39.   if gamestate == "dead" then
  40.     if pause == true then
  41.       pause = false
  42.     end
  43.    
  44.     love.graphics.setColor( 255, 0, 0 )
  45.     love.graphics.print( "You have died!", 0, 0, 0, 2, 2 )
  46.     love.graphics.draw( deathsymbol, 400, 300 )
  47.   end
  48. end
  49.  
  50. function love.mousepressed( x, y, button )
  51. mx = love.mouse.getX()
  52. my = love.mouse.getY()
  53.   print ( "X: " .. mx .. "     Y: " .. my )
  54.  
  55.   if button == "l" then
  56.     if gamestate == "menu" then
  57.       if mx >=200 and my >= 500 and mx <= 600 and my <= 550 then
  58.         gamestate = "playing"
  59.       end
  60.     elseif gamestate == "playing" then
  61.       circlecheck()
  62.     end
  63.    
  64.     if gamestate == "playing" then
  65.       if helpmenu == true then
  66.         if mx >= 560 and my >= 160 and mx <= 580 and my <= 180 then
  67.           helpmenu = false
  68.         end
  69.       end
  70.     end
  71.   end
  72. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement