Showing posts with label Applying gravity without a physics engine. Show all posts
Showing posts with label Applying gravity without a physics engine. Show all posts

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);
}

Followers