2011-04-17 80 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行動讓人想起跳躍動畫的好方法。