I want move object when i "tap" on the screen

HI ,

I have a problem , I want move my physic object when i “tap” on the screen 

more precisely , i would like remove (-5) in height every time I tap , for this moment i did this :

but with this , the object rise only once , i would like that every time i tap the objet rise a little :slight_smile:

thanks

I would make (-5) height every time I tap

When you tap once, the object goes to display.contentheight-100, and when you tap a second time, the function will re-positioning the object at display.contentheight-100 again. But it’s already on that position, so it doesn’t move.

The correct code is 

mainGauche.y=maingauche.y-5 //(on descend de 5 ! pas de 100)

Comme ça la dernière valeur de y est celle qui sera à modifier.

Et pour le début je pense que c’est mieux physics:addBody(mainGauche,“dynamic”).

Cordialement.

When you tap once, the object goes to display.contentheight-100, and when you tap a second time, the function will re-positioning the object at display.contentheight-100 again. But it’s already on that position, so it doesn’t move.

The correct code is 

mainGauche.y=maingauche.y-5 //(on descend de 5 ! pas de 100)

Comme ça la dernière valeur de y est celle qui sera à modifier.

Et pour le début je pense que c’est mieux physics:addBody(mainGauche,“dynamic”).

Cordialement.