所有,我正在制作一个游戏,其中一个精灵通过一个19像素的混蛋从一个位置移动到另一个位置,基本上我想制作一个像在线堆叠器一样的游戏。在应用程序商店中,在这个游戏中,盒子移动通过一个19 piexel的混蛋,并且对象移动在网格中,我有以下代码,但我没有给我这个混蛋动作
-(void)actionLayer
{
isRunning = 0;
addPixedlValue += 19;
id actionMove = [CCMoveTo actionWithDuration:6 position:ccp( 50,109)]; //300,100
id actionMoveDone = [CCCallFuncN actionWithTarget:self selector:@selector(LayerAction:)];
animateAction = [CCSequence actions:actionMove, actionMoveDone, nil];
NSLog(@"pixel value %d",addPixedlValue);
[boxSprite runAction:animateAction];
}
-(void)LayerAction:(id)sender
{
addPixedlValue +=19;
id actionMove = [CCMoveTo actionWithDuration:6 position:ccp( 270,109)]; //300,100
id actionMoveDone = [CCCallFuncN actionWithTarget:self selector:@selector(actionLayer)];
animateAction = [CCSequence actions:actionMove, actionMoveDone, nil];
[boxSprite runAction:animateAction];
}