Hey guys, I'm new. And need your help

Hey, my name is Evan Davis and I’m 13 years old. I recently got in coding and really wanted to learn how to! So after a few days of looking I found codea, which was the only coding platform for iOS without the use of a Mac. So after another few days of fiddling around with it I started getting used to it and now I’ve got a edited version of the EXAMPLE “flappy” I know it really sucks but I want to make it where if someone double taps the screen they die
Double tap the screen like within 2 seconds or something like that. Here’s the part in the code where it’s talking about the touch aspect of it

function touched(touch)
        if touch.state == BEGAN then
        if state == MENU then
            start()
            flapper:flap()
        elseif state == PLAYING then
            flapper:flap()
        elseif state == GAMEOVER and gameOverTimer <= 0 then
            reset() 

Now I know that this might be a little confusing, and not wrote the right way but any help would be much appreciated.THANKS SO MUCH!!!

Also congrats with codea it’s a very good app and has a AMAZING FAMILY on the website! Happy to be here guys! :slight_smile:

@EvanDavis Here’s an example of tapping the screen twice in a short time and printing “die”. Just add what you want instead of printing die.

function setup()
end

function draw()
    background(40, 40, 50)
end

function touched(t)
    if t.state==BEGAN then
        if t.tapCount==2 then
            print("die")
        end
    end
end

Hey Dave thanks for the quick response! Ill try that.

@EvanDavis Try this.

function touched(touch)
    if touch.state == BEGAN then
        if touch.tapCount==2 then
            flapper:flap()
        elseif state == PLAYING then
            flapper:flap()
        elseif state == GAMEOVER and gameOverTimer <= 0 then
            reset() 
        end
    end
end