Ejemplo n.º 1
0
        public override void OnEnter()
        {
            //
            // This test MUST be done in 'onEnter' and not on 'init'
            // otherwise the paused action will be resumed at 'onEnter' time
            //
            base.OnEnter();

            CCSize s = Layer.VisibleBoundsWorldspace.Size;

            CCLabelTtf l = new CCLabelTtf("After 5 seconds grossini should move", "arial", 16);
            AddChild(l);
            l.Position = (new CCPoint(s.Width / 2, 245));


            //
            // Also, this test MUST be done, after [super onEnter]
            //
            CCSprite grossini = new CCSprite(s_pPathGrossini);
            AddChild(grossini, 0, kTagGrossini);
            grossini.Position = (new CCPoint(200, 200));

            CCAction action = new CCMoveBy (1, new CCPoint(150, 0));

            grossini.AddAction(action, true);

            Schedule(unpause, 3);
        }
Ejemplo n.º 2
0
        public override void OnEnter() {
            base.OnEnter();

            if (Parent.Tag == Tags.Client) {
                var blades = new CCSprite(Resources.BossCardinalBlades) {
                    IsAntialiased = false,
                    PositionX = Texture.PixelsWide/2,
                    PositionY = Texture.PixelsHigh/2,
                };
                AddChild(blades, -1);


                blades.AddAction(new CCRepeatForever(new CCRotateBy(0.7f, -90)));
            }
        }
        private void AddCardinalImage(int p1, int p2) {
            var tmp = new CCSprite(Resources.BossCardinal) {
                Texture = {IsAntialiased = false},
                PositionX = p1,
                PositionY = p2,
                Scale = 6
            };

            var blades = new CCSprite(Resources.BossCardinalBlades) {
                Scale = 1,
                IsAntialiased = false,
                PositionX = tmp.Texture.PixelsWide/2,
                PositionY = tmp.Texture.PixelsHigh/2
            };

            blades.AddAction(new CCRepeatForever(new CCRotateBy(0.7f, -120)));
            tmp.AddChild(blades, -1);

            if (tmp.PositionX > Settings.ScreenWidth/2) {
                tmp.FlipX = true;
            }

            AddChild(tmp);
        }