I’m making a clicker game, and I’m wondering how to make it tap for you
search for clicker in this forum
@pauls4eva I’m not exactly sure what you’re after, but here’s what I think you want. Tap the button to increment the count. Press it for 2 seconds and it will start to increment on its own until you lift your finger.
function setup()
x=200
y=400
cnt=0
tm=0
end
function draw()
background(40, 40, 50)
fill(255)
rect(x,y,100,50)
text(cnt,WIDTH/2,HEIGHT-200)
if tm>0 and (os.time()-tm)>=2 then
cnt=cnt+1
end
end
function touched(t)
if t.state==BEGAN then
if t.x>x and t.x<t.x+100 and t.y>y and t.y<t.y+50 then
cnt=cnt+1
tm=os.time()
end
end
if t.state==ENDED then
tm=0
end
end
Thanks!
That’s what I was looking for