Example #1
0
        public override void onEnter()
        {
            base.onEnter();

            centerSprites(3);

            CCActionInterval   actionTo     = CCJumpTo.actionWithDuration(2, new CCPoint(300, 300), 50, 4);
            CCActionInterval   actionBy     = CCJumpBy.actionWithDuration(2, new CCPoint(300, 0), 50, 4);
            CCActionInterval   actionUp     = CCJumpBy.actionWithDuration(2, new CCPoint(0, 0), 80, 4);
            CCFiniteTimeAction actionByBack = actionBy.reverse();

            m_tamara.runAction(actionTo);
            m_grossini.runAction(CCSequence.actions(actionBy, actionByBack));
            m_kathia.runAction(CCRepeatForever.actionWithAction(actionUp));
        }
Example #2
0
        public MainLayer()
        {
            base.isTouchEnabled = true;

            CCSprite sprite = CCSprite.spriteWithFile(ClickAndMoveTest.s_pPathGrossini);

            CCLayer layer = CCLayerColor.layerWithColor(new ccColor4B(255, 255, 0, 255));

            addChild(layer, -1);

            addChild(sprite, 0, ClickAndMoveTest.kTagSprite);
            sprite.position = new CCPoint(20, 150);

            sprite.runAction(CCJumpTo.actionWithDuration(4, new CCPoint(300, 48), 100, 4));

            layer.runAction(CCRepeatForever.actionWithAction(
                                (CCActionInterval)(CCSequence.actions(
                                                       CCFadeIn.actionWithDuration(1),
                                                       CCFadeOut.actionWithDuration(1)))
                                ));
        }