Difference between revisions of "How to detect single mouse clicks"
Jump to navigation
Jump to search
(Created page with "WIP Category:How To Category:Mini Micro Category:Soda") |
|||
| Line 1: | Line 1: | ||
| − | + | <ms>wasDown = false | |
| + | while true // press Control-C to exit | ||
| + | isDown = mouse.button | ||
| + | if isDown and not wasDown then | ||
| + | print "Sprite clicked!" | ||
| + | end if | ||
| + | wasDown = isDown | ||
| + | yield | ||
| + | end while</ms> | ||
[[Category:How To]] | [[Category:How To]] | ||
[[Category:Mini Micro]] | [[Category:Mini Micro]] | ||
[[Category:Soda]] | [[Category:Soda]] | ||
Revision as of 09:39, 20 November 2021
wasDown = false
while true // press Control-C to exit
isDown = mouse.button
if isDown and not wasDown then
print "Sprite clicked!"
end if
wasDown = isDown
yield
end while