Score + Player + Detect object

Hi everyone,
 
I’m looking for any example/help of how to detect an object and when this object pass upper or lower from the player location sum one point to the score.
 
I’ll try to explain graphically:
 
bx04.png
 
So as you see on the image, one block has already pass throught the player and sum 1 point in the score.
 
But I don’t understand how to do it on LUA i’m very new at this.
 
This is my actual code, but this only sum the scrolling, this is not what i’m trying to do:

 

function createBlock() local b local rnd = math.floor(math.random() \* 5) + 1 b = display.newImage('block.png', display.contentWidth, yPos[math.floor(math.random() \* 5)+1]) b.name = 'block' -- Block physics physics.addBody(b, 'kinematic') b.isSensor = true blocks:insert(b) end --paint text scoreTF = display.newText('0', 135, 440, 'Marker Felt', 17) scoreTF:setTextColor(255, 255, 255) function update(e) -- Move player right if(right) then impulse = impulse - 3 player:setLinearVelocity(1, impulse) end -- Move Blocks if(blocks ~= nil)then for i = 1, blocks.numChildren do blocks[i].x = blocks[i].x - speed end scoreTF.text = tostring(tonumber(scoreTF.text) + 1) end

 
 
Thanks for the help.