同时跳跃和移动......帮助!

时间:2011-04-17 17:25:36

标签: cocos2d-iphone

正如标题所说,我一直在跳跃和移动,

这就是我沿'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轴运动相关的跳跃....非常感谢帮助

1 个答案:

答案 0 :(得分:0)

您想查看cocos2d中的操作示例。 CCBezierTo动作浮现在脑海中,想要一种动画跳跃的好方法。