2011-04-17 86 views
0

正如标题所说,我坚持用跳跃,并在同一时间移动,同时跳跃和移动......帮助!

这是我如何沿着“X”移动轴

-(void)collisionCheckingAndMovementRight:(ccTime)dt{ 

CGPoint tileCoord = [self tileCoordForPosition:player.position]; 
int tileGid = [csLayer tileGIDAt:tileCoord]; //csLayer is the layer which was created in tiled for the collision 
if (tileGid) { 
    NSDictionary *properties = [levelOne propertiesForGID:tileGid]; 
    if (properties) { 

     NSString *collision = [properties valueForKey:@"Collidable"]; 
     if (collision && [collision compare:@"True"] == NSOrderedSame){ 

      //[[SimpleAudioEngine sharedEngine] playEffect:@"hit.caf"]; 
      return; 

     } 

    } 

} 

player.position = ccp(player.position.x +100*dt, player.position.y); 

我想尝试做一个跳跃,伴随着我目前的x轴运动....帮助非常感谢

回答

0

你想看看在cocos2d中的动作示例。 CCBezierTo行动让人想起跳跃动画的好方法。