Circle the dot

I’m trying to make a game like circle the dot i just don’t now where to start
https://itunes.apple.com/us/app/circle-the-dot/id905410455?mt=8

@Dantheman2001 Start with this. Just tap a square to change it’s color.


displayMode(FULLSCREEN)

function setup()
    w1=WIDTH    -- save starting width
    h1=HEIGHT   -- save starting height
    size=30 -- size of squares
    w=w1/size-1  -- number of horizontal squares 
    h=h1/size-2 -- number of vertical squares
    colr=color(255,0,0)
    tab={}  -- table of touched squares
    col={}  -- color of touched square
end

function draw()
    background(40,40,50)
    for x=0,w do    -- loop for horizontal squares
        for y=0,h do    -- loop for vertical squares
            fill(255)   -- start with white
            for a,b in pairs(tab) do    -- loop thru touched table
                if x==b.x and y==b.y then   -- does square match touched table
                    fill(col[a])   -- if yes, then color it
                end
            end
            rect(x*size+10,y*size+10,size,size) -- draw square
        end
    end
end

function touched(t)
    if t.state==BEGAN then  -- screen was touched
        x1=math.floor((t.x-10)/size)    -- calculate x square position
        y1=math.floor((t.y-10)/size)    -- calculate y square position
        for a,b in pairs(tab) do    -- loop thru touched table
            if b.x==x1 and b.y==y1 then -- check if square was touched
                table.remove(tab,a) -- remove it from the table
                table.remove(col,a) -- remove it from the table
                return
            end
        end
        table.insert(tab,vec2(x1,y1))   -- square touched, add to table
        table.insert(col,colr)  -- square touched, add color to table
    end
end

@dave1707 thx for the table