Collision with enemy

I am having a problem with making the player die upon collision with an enemy. Here is my code atm. Basically what happens is the player (a ball) spawns, hits the ground and the game over message comes up. What I want to happen is when the player hits Ground4 the message comes up. Here is my current code:

[code]local function loadGround4()
ground = display.newImage(“Ground.png”);
ground.x = 400;
ground.y = 108;
ground.width = 150;
ground.rotation = 90
ground.height = 30;
physics.addBody(ground, {friction=0.5});
ground.bodyType = “static”;
world:insert(ground);
end

local function onCollision( event )
if ( event.phase == “began” ) then

Runtime:removeEventListener(“enterFrame”, onEnterFrame);
Runtime:removeEventListener(“touch”, onScreenTouched);
leftButton:removeEventListener(“touch”, onLeftTouched);
rightButton:removeEventListener(“touch”, onRightTouched);

–leftButton:removeSelf();
–rightButton:removeSelf();

–hideArrow();
world.alpha = 0.5;

local gameOverText = display.newText(“Game Over!”, 0, 0, native.systemFont, 30);
gameOverText.x = 160;
gameOverText.y = 240;

elseif ( event.phase == “ended” ) then

gameOver();

end
end

Runtime:addEventListener( “collision”, onCollision )[code] [import]uid: 18727 topic_id: 5437 reply_id: 305437[/import]

Also if anyone knows how to, how do I make a restart button so when the game over message comes up the player can just restart the level? [import]uid: 18727 topic_id: 5437 reply_id: 18224[/import]

Check this link

http://developer.anscamobile.com/reference/index/eventphase

You need to test which two objects collided and then act accordingly.
test if event.object1.myName == “ball” and event.object2.myName == “ground4”

You will need to add an identifier field to each object, like myName

eg.
ball.myName = “ball”
ground4.myName = “ground4” [import]uid: 8872 topic_id: 5437 reply_id: 18269[/import]