Score not going up !

In another post i was told putting this :

 elseif ( phase == "did" ) then physics.start() block:addEventListener( "collision",block ) myObject:addEventListener( "collision",myObject ) if event.phase == "began" and event.target == block and event.other == myObject then score.add(1) end -- Called when the scene is now on screen. -- Insert code here to make the scene come alive. -- Example: start timers, begin animation, play audio, etc. end end

In my collision handler would make the score go up ., It still stays at zero oncollision . What did I do wrong .What do I do to fix my mistake .

Thanks .

You seem to have put that inside of your scene’s show method. It should be in your onCollision function. That’s where you have your block’s collision events sent to, after all.

You seem to have put that inside of your scene’s show method. It should be in your onCollision function. That’s where you have your block’s collision events sent to, after all.