Page 1 of 1

Getting the mouse to click once?

Posted: Sat May 04, 2013 7:25 pm
by Bransonn
I'm currently working on a game, and I want the user to be able to click an "attack" button. Although whenever I use the

' if mouseclick = "l"

Kind of deal, it will CONSTANTLY ATTACK. I understand what it's doing, but I'm not sure how to make it so only registers the attack ONCE, and ONLY after the release of the click. I've been exploring different things, but haven't found any answers :/


Thank you!

Re: Getting the mouse to click once?

Posted: Sat May 04, 2013 7:29 pm
by Sheepolution
http://www.love2d.org/wiki/love.mousepressed

There's a function for that!

Be sure to take a loot at the wiki, to check for a solution for you problem.

Re: Getting the mouse to click once?

Posted: Sun May 05, 2013 1:00 pm
by rhezalouis
Please post your *.love file so that other people could easily fix it on the line. :huh: