画面上をランダムに動く敵の動きを作成しましたが、Y軸の動きから出てくることがありますが、Y軸の動きでスプライトが出ないようにするにはどうすればよいですか???? ??
これは、スプライトをランダムに移動するコードです。
[敵runAction:[CCSequenceアクション:[CCMoveByactionWithDuration:2.0位置:ccp(-winSize.width * 0.4、0)]、 [CCMoveBy actionWithDuration:randomValueBetween(1.0、0.3) position:ccp(randomValueBetween(winSize.width * 0.2、-winSize.width * 0.2)、 randomValueBetween(winSize.height * 0.2、-winSize.height * 0.2))]、 [CCDelayTime actionWithDuration:0.5]、 [CCMoveBy actionWithDuration:randomValueBetween(1.0、0.3) position:ccp(randomValueBetween(winSize.width * 0.2、-winSize.width * 0.2)、 randomValueBetween(winSize.height * 0.2、-winSize.height * 0.2))]、 [CCDelayTime actionWithDuration:0.5]、 [CCMoveBy actionWithDuration:randomValueBetween(1.0、0.3) position:ccp(randomValueBetween(winSize.width * 0.2、-winSize.width * 0.2)、 randomValueBetween(winSize.height * 0.2、-winSize.height * 0.2))]、 [CCDelayTime actionWithDuration:0.5]、 [CCMoveBy actionWithDuration:randomValueBetween(1.0、0.3) position:ccp(randomValueBetween(winSize.width * 0.2、-winSize.width * 0.2)、 randomValueBetween(winSize.height * 0.2、-winSize.height * 0.2))]、 [CCDelayTime actionWithDuration:0.5]、 [CCMoveBy actionWithDuration:randomValueBetween(1.0、0.3) position:ccp(randomValueBetween(winSize.width * 0.2、-winSize.width * 0.2)、 randomValueBetween(winSize.height * 0.2、-winSize.height * 0.2))]、 [CCDelayTime actionWithDuration:0.5]、 [CCMoveBy actionWithDuration:randomValueBetween(1.0、0.3) position:ccp(randomValueBetween(-winSize.width * 0.3、winSize.width * 0.3)、 randomValueBetween(winSize.height * 0.3、-winSize.height * 0.3))]、 [CCDelayTime actionWithDuration:0.5]、 [CCMoveBy actionWithDuration:randomValueBetween(1.0、0.3) position:ccp(randomValueBetween(-winSize.width * 0.2、winSize.width * 0.2)、 randomValueBetween(winSize.height * 0.2、-winSize.height * 0.2))]、 [CCDelayTime actionWithDuration:0.5]、 [CCMoveBy actionWithDuration:randomValueBetween(1.0、0.3) position:ccp(randomValueBetween(-winSize.width * 0.3、winSize.width * 0.3)、 randomValueBetween(winSize.height * 0.3、-winSize.height * 0.3))]、 [CCDelayTime actionWithDuration:0.5]、 [CCMoveBy actionWithDuration:randomValueBetween(1.0、0.3) position:ccp(randomValueBetween(-winSize.width * 0.2、winSize.width * 0.2)、 randomValueBetween(winSize.height * 0.2、-winSize.height * 0.2))]、 [CCDelayTime actionWithDuration:0.5]、 [CCMoveBy actionWithDuration:randomValueBetween(1.0、0.3) position:ccp(randomValueBetween(-winSize.width * 0.3、winSize.width * 0.3)、 randomValueBetween(winSize.height * 0.3、-winSize.height * 0.3))]、 [CCDelayTime actionWithDuration:0.5]、 [CCMoveBy actionWithDuration:randomValueBetween(1.0、0.3) position:ccp(randomValueBetween(-winSize.width * 0.2、winSize.width * 0.2)、 randomValueBetween(winSize.height * 0.2、-winSize.height * 0.2))]、 [CCDelayTime actionWithDuration:0.5]、 [CCMoveBy actionWithDuration:2.0 position:ccp(-winSize.width * 1.5、0)]、 [CCCallFuncN actionWithTarget:selfセレクター:@selector(invisNode :)]、nil]];