public override void onEnter() { base.onEnter(); CCNode bg = getChildByTag(EffectAdvanceScene.kTagBackground); CCNode target1 = bg.getChildByTag(EffectAdvanceScene.kTagSprite1); CCNode target2 = bg.getChildByTag(EffectAdvanceScene.kTagSprite2); CCActionInterval waves = CCWaves.actionWithWaves(5, 20, true, false, new ccGridSize(15, 10), 5); CCActionInterval shaky = CCShaky3D.actionWithRange(4, false, new ccGridSize(15, 10), 5); target1.runAction(CCRepeatForever.actionWithAction(waves)); target2.runAction(CCRepeatForever.actionWithAction(shaky)); //// moving background. Testing issue #244 //CCActionInterval move = CCMoveBy.actionWithDuration(3, new CCPoint(200, 0)); //bg.runAction(CCRepeatForever.actionWithAction((CCActionInterval)(CCSequence.actions(move)))); }
public override void onEnter() { base.onEnter(); CCActionInterval effect = (CCActionInterval)(CCSequence.actions(CCDelayTime.actionWithDuration(2.0f), CCShaky3D.actionWithRange(16, false, new ccGridSize(5, 5), 5.0f))); // cleanup CCNode bg = getChildByTag(EffectAdvanceScene.kTagBackground); removeChild(bg, true); // background CCLayerColor layer = CCLayerColor.layerWithColor(new ccColor4B(255, 0, 0, 255)); addChild(layer, -10); CCSprite sprite = CCSprite.spriteWithFile("Images/grossini"); sprite.position = new CCPoint(50, 80); layer.addChild(sprite, 10); // foreground CCLayerColor layer2 = CCLayerColor.layerWithColor(new ccColor4B(0, 255, 0, 255)); CCSprite fog = CCSprite.spriteWithFile("Images/Fog"); ccBlendFunc bf = new ccBlendFunc { src = 0x0302, dst = 0x0303 }; fog.BlendFunc = bf; layer2.addChild(fog, 1); addChild(layer2, 1); layer2.runAction(CCRepeatForever.actionWithAction(effect)); }
public static CCActionInterval actionWithDuration(float t) { return(CCShaky3D.actionWithRange(5, true, new ccGridSize(15, 10), t)); }