In my app I am simply moving one of the sprites I created in SpriteBuilder like so:
[_sprite.physicsBody applyImpulse:ccp(95.0f, 0.0f)];
However, if I continuously call this, it will make the sprite go much much faster than I like. Is there a way to use clampf or something to make sure the velocity of the _sprite.physicsBody is in check?
I tried something like this but obviously wont work because it expects float and not CGPoints:
_sprite.physicsBody.velocity = clampf(_sprite.physicsBody.velocity, CGPointMake(-100.0f, 0.0f), CGPointMake(0.0f, 100.0f));
But is there something similar to this that will achieve what I want while I still use my applyImpulse/applyForce methods to move my physicsBody? Any help would be appreciated.