Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- menu = 1
- function love.keypressed(key)
- if key == "up" then
- menu = menu - 1
- elseif key == "down" then
- menu = menu + 1
- end
- end
- function love.draw()
- cursor = love.graphics.newImage("cursor.png")
- love.graphics.setCaption("Maze Game")
- love.graphics.setColor(0, 0, 255)
- if menu == 1 then
- love.graphics.setColor(255, 0, 0)
- love.graphics.draw(cursor, 300, 200)
- end
- love.graphics.print("Jugar", 320, 200, 0, 2, 2)
- love.graphics.setColor(0, 0, 255)
- if menu == 2 then
- love.graphics.setColor(255, 0, 0)
- love.graphics.draw(cursor, 300, 300)
- end
- love.graphics.print("Opciones", 320, 300, 0, 2, 2)
- love.graphics.setColor(0, 0, 255)
- if menu == 3 then
- love.graphics.setColor(255, 0, 0)
- love.graphics.draw(cursor, 300, 400)
- end
- love.graphics.print("Salir", 320, 400, 0, 2, 2)
- end
- function love.update()
- if menu > 3 then
- menu = 1
- elseif menu < 1 then
- menu = 3
- end
- if menu == 1 and love.keyboard.isDown("return") then
- require("level1")
- end
- if menu == 2 and love.keyboard.isDown("return") then
- require("menu2")
- end
- if menu == 3 and love.keyboard.isDown("return") then
- love.event.push("quit")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement