Currently struggling to make a clickable button function. anyone got anything?
_G.love = require 'love'
function love.load()creature = {}creature.rep = 0love.mouse.setCursor(mousepng)cursor2 = love.graphics.newImage('cursor2.png')love.mouse.setVisible(false)end
function love.update(dt)
end
function love.draw()x, y = love.mouse.getPosition()love.graphics.print(creature.rep, 10, 10)love.graphics.draw(cursor2, x, y)love.graphics.rectangle('line', 300, 400, 100, 100)love.graphics.print(x)love.graphics.print(y, 30)end
function love.mousepressed(x, y, button)if button == 1 thenif x < 300 and x > 400 and y < 500 and y > 400 thencreature.rep = creature.rep +1endendend
ignore the 'creature' thing. its going to be a horror game. when i click withing the boundries set the number dosent change at all. very confused.