我是 cocos2d 的初学者,我遇到了让我的精灵在垂直方向跳跃的问题,所以请任何人都可以帮助我摆脱这种情况......这是我的代码......
-(id) init
{
if( (self=[super init])) {
// enable touches
self.isTouchEnabled = YES;
// enable accelerometer
self.isAccelerometerEnabled = YES;
ManStanding = [CCSprite spriteWithFile:@"ManStanding.png"];
[ManStanding setPosition:ccp(40,0)];
[self addChild:ManStanding];
}
return self;
}
-(BOOL)ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event
{
id jump = [CCJumpBy actionWithDuration:1 position:ccp(100, 0)
height:50 jumps:1];
[ManStanding runAction:jump];
}
谁能指导我我做错了什么..
提前谢谢...