NainSaatTyttoystavanFeatJoh.../level1.lua
2020-09-27 15:04:17 +03:00

50 lines
1.4 KiB
Lua

state = {}
function state:enter()
love.graphics.setBackgroundColor(0.9, 0.9, 0.9)
end
function state:draw()
love.graphics.setColor(1, 1, 1)
love.graphics.rectangle("fill", 93, 110, 500, 150)
love.graphics.draw(Images["level1"], 687, 110)
love.graphics.setColor(0, 0, 0)
love.graphics.rectangle("line", 687, 110, 500, 500)
love.graphics.rectangle("line", 93, 110, 500, 150)
love.graphics.setFont(Font35)
love.graphics.print("Haluan neitsyen, luonteella ja iällä\nei väliä.", 103, 117)
love.graphics.setFont(Font60)
love.graphics.setColor(0, 0, 0)
if love.mouse.getX() > 120 and love.mouse.getX() < 600 then
if love.mouse.getY() > 300 and love.mouse.getY() < 360 then
love.graphics.setColor(0.6, 0.6, 0.6)
end
end
love.graphics.print("- Kyllä", 120, 300)
love.graphics.setColor(0, 0, 0)
if love.mouse.getX() > 120 and love.mouse.getX() < 600 then
if love.mouse.getY() > 380 and love.mouse.getY() < 440 then
love.graphics.setColor(0.6, 0.6, 0.6)
end
end
love.graphics.print("- Ei", 120, 380)
end
function state:mousereleased(x, y, button, istouch, presses)
if x > 120 and x < 600 then
if y > 300 and y < 360 then
Sounds["click"]:play()
Gamestate.switch(States["level2"])
elseif y > 380 and y < 440 then
Sounds["click"]:play()
Gamestate.switch(States["lose"])
end
end
end
return state