Beispiel #1
0
        public MainGameScene()
        {
            _shardMainGame = this;
            MainGameLogic.SharedMainGameLogic().IsGameStart = true;

            CardShow = new MGNode();

            _bg_day_sky = MGSprite.MGSpriteWithSpriteFrameName("白天天空.png");
            AddChild(_bg_day_sky);
            _bg_day_sky.Anchor = new Vector2(.5f, 0);
            _bg_day_sky.Position = new Vector2(1366 / 2f, 768f);

            _bg_night_sky = MGSprite.MGSpriteWithSpriteFrameName("晚上天空.png");
            AddChild(_bg_night_sky);
            _bg_night_sky.Anchor = new Vector2(.5f, 0);
            _bg_night_sky.Position = new Vector2(1366 / 2f, 768f);
            _bg_night_sky.Visible = false;

            sunSprite = MGSprite.MGSpriteWithSpriteFrameName("日.png");
            moonSprite = MGSprite.MGSpriteWithSpriteFrameName("月.png");

            AddChild(sunSprite);
            AddChild(moonSprite);
            sunSprite.Position = new Vector2(1133, 716);
            moonSprite.Position = new Vector2(1133, 536);
            //moonSprite.Visible = false;

            _bg_day = MGSprite.MGSpriteWithFilename("Images/bg_day_main");
            AddChild(_bg_day);
            _bg_day.Anchor = new Vector2(0, 1);
            //_bg_day.Visible = false;

            _bg_night = MGSprite.MGSpriteWithFilename("Images/bg_night_main");
            AddChild(_bg_night);
            _bg_night.Anchor = new Vector2(0, 1);
            _bg_night.Visible = false;

            AddChild(WireShowLayer.SharedWireShow());
            WireShowLayer.SharedWireShow().Init();

            AddChild(Card.CardShowLayer.SharedCardShow());
            Card.CardShowLayer.SharedCardShow().Init();

            AddChild(Zombie.ZombieShowLayer.SharedZombieShow());
            Zombie.ZombieShowLayer.SharedZombieShow().Init();

            CoverLayer = new MGColorLayer(new Rectangle(0, 0, Config.ORI_WIN_HEIGHT, Config.ORI_WIN_WIDTH));
            AddChild(CoverLayer);
            CoverLayer.Opacity = 200;
            CoverLayer.SetColor(150, 150, 150);
            CoverLayer.Visible = false;

            var box = new Box();
            AddChild(box);
            box.Position = new Vector2(0, 768 - 55);
            AddChild(CardShow);

            AddChild(new TouchLayer());
        }
Beispiel #2
0
        public TeachingScene()
        {
            _shardMainGame = this;
            IsTeaching = true;

            CardShow = new MGNode();

            _bg_day_sky = MGSprite.MGSpriteWithSpriteFrameName("白天天空.png");
            AddChild(_bg_day_sky);
            _bg_day_sky.Anchor = new Vector2(.5f, 0);
            _bg_day_sky.Position = new Vector2(1366 / 2f, 768f);

            _bg_day = MGSprite.MGSpriteWithFilename("Images/bg_day_main");
            AddChild(_bg_day);
            _bg_day.Anchor = new Vector2(0, 1);

            List<Wire> wires = new List<Wire>();
            wires.Add(new Wire(new IntVector(0, -1), WireType.WireT, WireDirection.WireLeft));
            wires.Add(new Wire(new IntVector(0, -1), WireType.WireI, WireDirection.WireLeft));
            wires.Add(new Wire(new IntVector(0, -1), WireType.WireL, WireDirection.WireLeft));
            wires.Add(new Wire(new IntVector(0, -1), WireType.WireL, WireDirection.WireDown));
            wires.Add(new Wire(new IntVector(0, -1), WireType.WireT, WireDirection.WireDown));
            wires.Add(new Wire(new IntVector(0, -1), WireType.WireL, WireDirection.WireDown));

            wires.Add(new Wire(new IntVector(1, -1), WireType.WireI, WireDirection.WireLeft));
            wires.Add(new Wire(new IntVector(1, -1), WireType.WireL, WireDirection.WireRight));
            wires.Add(new Wire(new IntVector(1, -1), WireType.WireX, WireDirection.WireLeft));
            wires.Add(new Wire(new IntVector(1, -1), WireType.WireT, WireDirection.WireLeft));
            wires.Add(new Wire(new IntVector(1, -1), WireType.WireT, WireDirection.WireRight));
            wires.Add(new Wire(new IntVector(1, -1), WireType.WireT, WireDirection.WireLeft));

            wires.Add(new Wire(new IntVector(2, -1), WireType.WireI, WireDirection.WireLeft));
            wires.Add(new Wire(new IntVector(2, -1), WireType.WireT, WireDirection.WireLeft));
            wires.Add(new Wire(new IntVector(2, -1), WireType.WireL, WireDirection.WireDown));
            wires.Add(new Wire(new IntVector(2, -1), WireType.WireL, WireDirection.WireUp));
            wires.Add(new Wire(new IntVector(2, -1), WireType.WireI, WireDirection.WireRight));
            wires.Add(new Wire(new IntVector(2, -1), WireType.WireT, WireDirection.WireDown));

            wires.Add(new Wire(new IntVector(3, -1), WireType.WireI, WireDirection.WireLeft));
            wires.Add(new Wire(new IntVector(3, -1), WireType.WireT, WireDirection.WireUp));
            wires.Add(new Wire(new IntVector(3, -1), WireType.Wirei, WireDirection.WireDown));
            wires.Add(new Wire(new IntVector(3, -1), WireType.Wirei, WireDirection.WireUp));
            wires.Add(new Wire(new IntVector(3, -1), WireType.WireX, WireDirection.WireRight));
            wires.Add(new Wire(new IntVector(3, -1), WireType.WireT, WireDirection.WireDown));

            wires.Add(new Wire(new IntVector(4, -1), WireType.WireL, WireDirection.WireLeft));
            wires.Add(new Wire(new IntVector(4, -1), WireType.WireL, WireDirection.WireDown));
            wires.Add(new Wire(new IntVector(4, -1), WireType.Wirei, WireDirection.WireUp));
            wires.Add(new Wire(new IntVector(4, -1), WireType.WireT, WireDirection.WireUp));
            wires.Add(new Wire(new IntVector(4, -1), WireType.WireL, WireDirection.WireUp));
            wires.Add(new Wire(new IntVector(4, -1), WireType.WireI, WireDirection.WireLeft));

            wires.Add(new Wire(new IntVector(5, -1), WireType.WireX, WireDirection.WireLeft));
            wires.Add(new Wire(new IntVector(5, -1), WireType.WireI, WireDirection.WireLeft));
            wires.Add(new Wire(new IntVector(5, -1), WireType.WireI, WireDirection.WireRight));
            wires.Add(new Wire(new IntVector(5, -1), WireType.WireL, WireDirection.WireDown));
            wires.Add(new Wire(new IntVector(5, -1), WireType.WireI, WireDirection.WireUp));
            wires.Add(new Wire(new IntVector(5, -1), WireType.WireT, WireDirection.WireRight));

            wires.Add(new Wire(new IntVector(6, -1), WireType.WireI, WireDirection.WireLeft));
            wires.Add(new Wire(new IntVector(6, -1), WireType.WireT, WireDirection.WireLeft));
            wires.Add(new Wire(new IntVector(6, -1), WireType.Wirei, WireDirection.WireUp));
            wires.Add(new Wire(new IntVector(6, -1), WireType.WireT, WireDirection.WireRight));
            wires.Add(new Wire(new IntVector(6, -1), WireType.WireL, WireDirection.WireDown));
            wires.Add(new Wire(new IntVector(6, -1), WireType.WireT, WireDirection.WireLeft));

            wires.Add(new Wire(new IntVector(7, -1), WireType.WireT, WireDirection.WireLeft));
            wires.Add(new Wire(new IntVector(7, -1), WireType.WireI, WireDirection.WireLeft));
            wires.Add(new Wire(new IntVector(7, -1), WireType.WireI, WireDirection.WireUp));
            wires.Add(new Wire(new IntVector(7, -1), WireType.WireL, WireDirection.WireLeft));
            wires.Add(new Wire(new IntVector(7, -1), WireType.Wirei, WireDirection.WireDown));
            wires.Add(new Wire(new IntVector(7, -1), WireType.WireL, WireDirection.WireUp));

            wires.Add(new Wire(new IntVector(8, -1), WireType.WireL, WireDirection.WireRight));
            wires.Add(new Wire(new IntVector(8, -1), WireType.WireL, WireDirection.WireLeft));
            wires.Add(new Wire(new IntVector(8, -1), WireType.WireL, WireDirection.WireUp));
            wires.Add(new Wire(new IntVector(8, -1), WireType.WireL, WireDirection.WireRight));
            wires.Add(new Wire(new IntVector(8, -1), WireType.WireI, WireDirection.WireDown));
            wires.Add(new Wire(new IntVector(8, -1), WireType.Wirei, WireDirection.WireDown));

            AddChild(WireShowLayer.SharedWireShow());
            WireShowLayer.SharedWireShow().Init(wires);

            //AddChild(Card.CardShowLayer.SharedCardShow());
            //Card.CardShowLayer.SharedCardShow().Init();

            AddChild(Zombie.ZombieShowLayer.SharedZombieShow());
            Zombie.ZombieShowLayer.SharedZombieShow().Init();

            CoverLayer = new MGColorLayer(new Rectangle(0, 0, Config.ORI_WIN_HEIGHT, Config.ORI_WIN_WIDTH));
            CoverLayer.Opacity = 200;
            CoverLayer.SetColor(150, 150, 150);
            CoverLayer.Visible = false;
            AddChild(CoverLayer);

            touchLayer = new TeachingLayer();
            AddChild(touchLayer);
            touchLayer.IsTouchEnable = false;

            _tapTip = MGSprite.MGSpriteWithFilename("images/tapTip");
            AddChild(_tapTip, 9);
            _tapTip.Visible = false;

            AddChild(HelpLayer.SharedHelp());
        }