public ButtonJumpLarge()
 {
     asc  = new CCMoveBy(0.3f, new CCPoint(0, 5));
     desc = asc.Reverse();
     buttonPress.Action = new CCSequence(desc, asc);
     sprite             = new CCSprite("images/jumpButtonLarge");
 }
Exemple #2
0
        public SpriteBatchNodeChildren()
        {
            CCSpriteBatchNode batch = new CCSpriteBatchNode("animations/grossini", 50);

            AddChild(batch, 0, (int)kTags.kTagSpriteBatchNode);

            CCSpriteFrameCache.SharedSpriteFrameCache.AddSpriteFrames("animations/grossini.plist");

            sprite1 = new CCSprite("grossini_dance_01.png");
            sprite2 = new CCSprite("grossini_dance_02.png");
            sprite3 = new CCSprite("grossini_dance_03.png");

            batch.AddChild(sprite1);
            sprite1.AddChild(sprite2);
            sprite1.AddChild(sprite3);

            var    animFrames = new List <CCSpriteFrame>();
            string str        = "";

            for (int i = 1; i < 15; i++)
            {
                string temp = "";
                if (i < 10)
                {
                    temp = "0" + i;
                }
                else
                {
                    temp = i.ToString();
                }
                str = string.Format("grossini_dance_{0}.png", temp);
                CCSpriteFrame frame = CCSpriteFrameCache.SharedSpriteFrameCache[str];
                animFrames.Add(frame);
            }

            animation = new CCAnimation(animFrames, 0.2f);

            action        = new CCMoveBy(2, new CCPoint(200, 0));
            action_back   = (CCFiniteTimeAction)action.Reverse();
            action_rot    = new CCRotateBy(2, 360);
            action_s      = new CCScaleBy(2, 2);
            action_s_back = (CCFiniteTimeAction)action_s.Reverse();

            seq2 = (CCFiniteTimeAction)action_rot.Reverse();
        }
        void AddNewSpriteWithCoords(CCPoint p)
        {
            CCSpriteBatchNode BatchNode = (CCSpriteBatchNode)this[(int)kTags.kTagSpriteBatchNode];

            int idx = (int)(CCRandom.NextDouble() * 1400 / 100);
            int x   = (idx % 5) * 85;
            int y   = (idx / 5) * 121;


            CCSprite sprite = new CCSprite(BatchNode.Texture, new CCRect(x, y, 85, 121));

            sprite.Position = (new CCPoint(p.X, p.Y));
            BatchNode.AddChild(sprite);


            CCFiniteTimeAction action = null;
            var random = (float)CCRandom.NextDouble();

            if (random < 0.20)
            {
                action = scaleBy;
            }
            else if (random < 0.40)
            {
                action = rotateBy;
            }
            else if (random < 0.60)
            {
                action = blink;
            }
            else if (random < 0.8)
            {
                action = tintBy;
            }
            else
            {
                action = fadeOut;
            }

            sprite.RepeatForever(action, action.Reverse());
        }
Exemple #4
0
 public override CCFiniteTimeAction Reverse()
 {
     return(new CCRepeat(m_pInnerAction.Reverse(), m_uTimes));
 }
Exemple #5
0
 public override CCFiniteTimeAction Reverse()
 {
     return(new CCTargetedAction(m_pForcedTarget, m_pAction.Reverse()));
 }