Collision Detection Help

Can someone help me with this code. It does not want to to print out “touch star”. When the “hero” collide with the “star” it say “ouch” instead of “touch star”.

hero.collision = heroCollision
Runtime:addEventListener(“collision”, hero)

function heroCollision (self, event)

    if event.phase == “began” then
        if event.self.id == “hero” and event.other.id == “star” then
        print (“touch star”)
        end
    else
        print (“ouch”)
    end

end

Can someone tell me if I’m writing the codes correctly? Is there another way of writing these codes? Sorry I’m new to Corona and Lua. What I really want to do is have multiple collision events, but I can’t figure out how to do it. For an example if “hero” collide with star add 1 point and if it collide with other stuff game will end.

Can someone tell me if I’m writing the codes correctly? Is there another way of writing these codes? Sorry I’m new to Corona and Lua. What I really want to do is have multiple collision events, but I can’t figure out how to do it. For an example if “hero” collide with star add 1 point and if it collide with other stuff game will end.