and by using applyImpulse and passing the touch location CGPoint, i manage to make the box jump a little bit.
This is the problem. Using applyImpulse
is the right way to do it, however you need to provide the direction of the impulse as the CGPoint parameter. You do not want to use the touch location as impulse direction.
To apply an impulse only to the left you need to create a new CGPoint
for the impulse direction and the y value of this point should be 0:
CGPoint impulse = ccp(-10.f, 0.f);
Then pass this point to the method.