If you dare to try and complete the actual implementation of this method… let me know if it works. 
The following is just a basic structure to give the idea:
[lua]touches = {}
grid = {size = 0.05} – 1/20th screen size
grid.gx = 320*grid.size – i.e. grid size = 16 x 24 in portrait mode
grid.gy = 480*grid.size
local function registerTouch(evt) – to be implemented in actual multi-touch environment
local nx,ny = math.ceil(evt.x * grid.size), math.ceil(evt.y * grid.size) – converts to grid size
local curgrid = ((ny - 1)*grid.gx) + nx – linearizes coordinates to a single cell number
if evt.phase ~= “ended” then
if not touches[curgrid] then
touches[curgrid] = true – put whatever you want/need
end
else
touches[curgrid] = nil
end
end
– at this point you simply count touches…
– but you need to count for pairs() or ipairs() of the table[/lua]
This basically represents the whole screen as a grid that is grid.size coarse. Coordinates of each touch are “linearized” and coarsed based on the grid parameters - otherwise you should have used a bi-dimensional array.
So, if a “cell” in the grid is already busy, it does not register the new touch. So the count of touches stays the same. If a touch on a given cell is “ended” then it removes the state from the touches table.
It should be easy enough to generalize for multi-touch. (?!) [import]uid: 5750 topic_id: 3914 reply_id: 12356[/import]