Simple score

Hi people i making a truck game thats transport boxes i need to create a score thats calculate how many boxes the truck have when he pass the finish line.

here the code to create the box

[lua]
caixa = {}
for i = 0, 4 do
caixa[i] = display.newImageRect(“crate.png”,20,20)
caixa[i].x = 80 - (2*i)
caixa[i].y = 100
physics.addBody(caixa[i],“dynamic”,{density = 5, friction = 1})

end

[/lua]
and the function that i dont know how im calculate the total of the box and multiply to 1000[lua]
local function TotalScore(e)

end
linhaChegada:addEventListener(“collision”, TotalScore)
[/lua]
Someone? [import]uid: 154714 topic_id: 36047 reply_id: 336047[/import]