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