Monday, January 31, 2011

Applying gravity without a physics engine


const float kGravity = 0.2f;

-(void) update:(ccTime)delta
{
 velocity.y -= kGravity;
 self.position = CGPointMake(position_.x + velocity.x, position_.y + velocity.y);
}

No comments:

Post a Comment

Followers