Here is the code related to the difficulty option.
Code: Select all
state = mainmenu
mode = "Easy"
function love.update()
if state == mainmenu then
if love.mouse.isDown("l") then
local x, y = love.mouse.getPosition()
if x >= 50 and x <= 175 and y >= 151 and y <= 175 and mode == "Easy" then -- Difficulty Easy Button Position
mode = "Medium"
end
if x >= 50 and x <= 175 and y >= 151 and y <= 175 and mode == "Medium" then -- Difficulty Medium Button Position
mode = "Hard"
end
if x >= 50 and x <= 175 and y >= 151 and y <= 175 and mode == "Hard" then -- Difficulty Hard Button Position
mode = "Easy"
end
end
end
end
function love.draw()
if state == mainmenu then
love.graphics.print("Difficulty:", 50, 150)
if mode == "Easy" then
love.graphics.print("Easy", 135, 150)
end
if mode == "Medium" then
love.graphics.print("Medium", 135, 150)
end
if mode == "Hard" then
love.graphics.print("Hard", 135, 150)
end
end
end
Thanks