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軸運動....幫助非常感謝