NainSaatTyttoystavanFeatJoh.../level21.lua

64 lines
1.9 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["level21"], 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("Joustan kriteereissä ja pääsen\nlähelle pesää, mikä menee vikaan?", 103, 117)
love.graphics.setFont(Font35)
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.setFont(Font35)
love.graphics.print("- Jännityksen takia timumiekka\n ei ole terässä.", 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.setFont(Font45)
love.graphics.print("- En osaa käyttää kondomia.", 120, 380)
love.graphics.setColor(0, 0, 0)
if love.mouse.getX() > 120 and love.mouse.getX() < 600 then
if love.mouse.getY() > 460 and love.mouse.getY() < 520 then
love.graphics.setColor(0.6, 0.6, 0.6)
end
end
love.graphics.setFont(Font60)
love.graphics.print("- Tyttö teki oharit.", 120, 460)
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["lose"])
elseif y > 380 and y < 440 then
Sounds["click"]:play()
Gamestate.switch(States["level22"])
elseif y > 460 and y < 520 then
Sounds["click"]:play()
Gamestate.switch(States["lose"])
end
end
end
return state