コード例 #1
0
ファイル: ParallaxTest.cs プロジェクト: hcxyzlm/CocosNet-1
        public Parallax1()
        {
            Sprite cocosImage = new Sprite("powered.png");

            cocosImage.Scale = 2.5f;
            cocosImage.AnchorPoint = PointF.Empty;

            // TileMapAtlas is deprecated in Cocos2D in favor of TMXTiledMap,
            // so probably not going to bother implementing TileMapAtlas

            // TODO: place a TMXTiledMap here instead

            //TileMapAtlas tileMap = new TileMapAtlas("tiles.png", "levelMap.tga", 16, 16);
            //
            //			tileMap.AnchorPoint = PointF.Empty;

            Sprite background = new Sprite("background.png");

            background.Scale = 1.5f;
            background.AnchorPoint = PointF.Empty;

            ParallaxNode voidNode = new ParallaxNode();

            voidNode.AddChild(background, -1, new PointF(0.4f, 0.5f), PointF.Empty);
            //			voidNode.AddChild(tileMap, 1, new PointF(2.2f, 1f), new PointF(0, -200));
            voidNode.AddChild(cocosImage, 2, new PointF(3f, 2.5f), new PointF(200, 800));

            MoveBy goUp = new MoveBy(4, new PointF(0, -500));
            MoveBy goDown = goUp.Reverse() as MoveBy;
            MoveBy goForward = new MoveBy(8, new PointF(-1000, 0));
            MoveBy goBack = goForward.Reverse() as MoveBy;
            Sequence sequence = Sequence.Construct(goUp, goForward, goDown, goBack);

            voidNode.RunAction(new RepeatForever(sequence));

            AddChild(voidNode, 0, ParallaxNodeTag);
        }
コード例 #2
0
ファイル: SpriteTest.cs プロジェクト: hcxyzlm/CocosNet-1
        public override void OnEnter()
        {
            base.OnEnter();
            _tamara.Visible = false;

            MoveBy move1 = new MoveBy(1, new PointF(250, 0));
            MoveBy move2 = new MoveBy(1, new PointF(0, 50));
            Sequence seq = Sequence.Construct(move1, move2, move1.Reverse() as FiniteTimeAction);
            Sequence action = Sequence.Construct(seq, seq.Reverse() as FiniteTimeAction);

            _grossini.RunAction(action);
        }
コード例 #3
0
ファイル: SpriteTest.cs プロジェクト: hcxyzlm/CocosNet-1
        public override void OnEnter()
        {
            base.OnEnter();
            MoveBy move1 = new MoveBy(1, new PointF(250, 0));
            MoveBy move2 = new MoveBy(1, new PointF(0, 50));
            ToggleVisibility tog1 = new ToggleVisibility();
            ToggleVisibility tog2 = new ToggleVisibility();
            Sequence seq = Sequence.Construct(move1, tog1, move2, tog2, move1.Reverse() as FiniteTimeAction);
            Repeat action = new Repeat(Sequence.Construct(seq, seq.Reverse() as FiniteTimeAction), 3);

            _grossini.RunAction(action);

            MoveBy move_tamara = new MoveBy(1, new PointF(100, 0));
            MoveBy move_tamara2 = new MoveBy(1, new PointF(50, 0));
            Hide hide = new Hide();
            Sequence seq_tamara = Sequence.Construct(move_tamara, hide, move_tamara2);
            Sequence seq_back = seq_tamara.Reverse() as Sequence;
            _tamara.RunAction(Sequence.Construct(seq_tamara, seq_back));
        }
コード例 #4
0
ファイル: SpriteTest.cs プロジェクト: hcxyzlm/CocosNet-1
        public override void OnEnter()
        {
            base.OnEnter();

            MoveBy a1 = new MoveBy(1, new PointF(150, 0));
            Repeat action1 = new Repeat(new Sequence(new Place(new PointF(60, 60)), a1), 3);
            RepeatForever action2 = new RepeatForever(new Sequence(a1.Clone() as FiniteTimeAction, a1.Reverse() as FiniteTimeAction));

            _grossini.RunAction(action1);
            _tamara.RunAction(action2);
        }
コード例 #5
0
ファイル: SpriteTest.cs プロジェクト: hcxyzlm/CocosNet-1
        public override void OnEnter()
        {
            base.OnEnter();

            SizeF s = Director.Instance.WinSize;

            var actionTo = new MoveTo(2, new PointF(s.Width - 40, s.Height - 40));
            var actionBy = new MoveBy(2, new PointF(80, 80));

            _tamara.RunAction(actionTo);
            _grossini.RunAction(new Sequence(actionBy, actionBy.Reverse() as IntervalAction));
        }
コード例 #6
0
ファイル: SpriteTest.cs プロジェクト: hcxyzlm/CocosNet-1
        public override void OnEnter()
        {
            base.OnEnter();

            _tamara.Visible = false;
            MoveBy move = new MoveBy(1, new PointF(150, 0));
            Sequence action = Sequence.Construct(move, new DelayTime(2), move);

            _grossini.RunAction(action);
        }
コード例 #7
0
ファイル: Action.cs プロジェクト: hcxyzlm/CocosNet-1
        public override Action Clone()
        {
            MoveTo newMoveTo = new MoveBy(Duration, _endPosition);
            newMoveTo._delta = _delta;

            return newMoveTo;
        }
コード例 #8
0
ファイル: Action.cs プロジェクト: hcxyzlm/CocosNet-1
        public override Action Clone()
        {
            MoveBy newMoveBy = new MoveBy(Duration, _delta);

            return newMoveBy;
        }