Hi!
Thanks for the compliments! I am always happy to see a new Sparrow user =)
What you describe is best solved without tweens, but with an enter frame event handler. This method is called once per frame, and you get the exact time that has passed. In this event handler, you can update the velocity of the object (depending on gravity, etc.) and move it to the new point.
The physics of PenguFlip are handled that way.
First, I created a subclass of SPSprite which adds some physical properties to an object:
@interface PhysicalSprite : SPSprite
{
SPPoint *mVelocity;
float mMass;
float mDrag; // air resistance
}
@property (nonatomic, retain) SPPoint *velocity;
@property (nonatomic, assign) float drag;
@property (nonatomic, assign) float mass;
@end
Now, in the main game class, you add the enter frame event listener:
[self addEventListener:@selector(onEnterFrame:) atObject:self
forType:SP_EVENT_TYPE_ENTER_FRAME];
And the corresponding listener:
- (void)onEnterFrame:(SPEnterFrameEvent *)event
{
[self applyPhysicsOnObject:myCannonBall passedTime:event.passedTime];
}
This method will be called once per frame. "myCannonBall" would be the object you want to animate based on physics. The physics method I call above then calculates all forces like gravity and drag, and moves the object correspondingly.
If you want, I can post this function as well -- but I don't want to spoil anything, in case you want to do that yourself =)
But if you'd like to see it, don't hesitate to ask, I will happily paste it here
Good luck!