Getting the mouse to click once?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Bransonn
Prole
Posts: 8
Joined: Wed Apr 24, 2013 6:13 pm

Getting the mouse to click once?

Post 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!
User avatar
Sheepolution
Party member
Posts: 264
Joined: Mon Mar 04, 2013 9:31 am
Location: The Netherlands
Contact:

Re: Getting the mouse to click once?

Post 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.
User avatar
rhezalouis
Party member
Posts: 100
Joined: Mon Dec 07, 2009 10:27 am
Location: Indonesia
Contact:

Re: Getting the mouse to click once?

Post by rhezalouis »

Please post your *.love file so that other people could easily fix it on the line. :huh:
Attachments
bransonn-mouseClick.love
LÖVE 0.8.0
(1021 Bytes) Downloaded 209 times
Aargh, I am wasting my posts! My citizenshiiiip... :o
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 224 guests