Hello, i have one question to trying to solve, but any post solve my problem yet.
My problem:
i'm trying to use cpBodyApplyImpulse to simulate a parabola shoot (like a angry birds game), but i doesn't understand how exaclty works.
So this is method to simulate my shoot.
-(void)shoot:(SpaceManager*)smgr location:(CGPoint)myPoint{
//This code works fine, but, this is not a parabola is only a line shoot.
id animation = [CCMoveTo actionWithDuration:2 position:ccp(myPoint.x, myPoint.y)];
id animation2 = [CCMoveTo actionWithDuration:5 position:ccp(myPoint.x, myPoint.y)];
id remove = [CCCallFuncND actionWithTarget:self selector:@selector(removeShoot:) data:smgr];
id seq = [CCSequence actions:animation, animation2, remove, nil];
[self runAction:seq];
//I guess i need something like this plus something else.
//cpBodyApplyImpulse(self.shape->body, cpv(1,0), cpv(100, 40));
//Other method
/*
ccBezierConfig bezier;
bezier.controlPoint_1 = ccp(100, 100);
bezier.controlPoint_2 = ccp(myPoint.x,myPoint.y);
bezier.endPosition = ccp(self.position.x,self.position.y);// i know this back to empty point.
id move1 = [CCBezierTo actionWithDuration:8 bezier:bezier];
id seq = [CCSequence actions:move1, nil];
[self runAction:seq];
*/
}
What can i use to make a parabola shoot for a best practice?
thanks