コード例 #1
0
        public override void Start()
        {
            //先加载资源
            GameData.LoadTextureInfo("Battles//background.png");
            GameData.LoadTextureInfo("Battles//BoundaryWarning.png");
            GameData.LoadTextureInfo("Battles//primitive.png");
            GameData.LoadTextureInfo("Battles//star.png");
            GameData.LoadTextureInfo("Battles//test.png");
            GameData.LoadTextureInfo("Battles//testship.png");
            GameData.LoadTextureInfo("Battles//testwingman.png");

            bacgroundBack = new Layer();
            bacground     = new Layer();
            middle        = new Layer();
            front         = new Layer();

            this.AddChild(bacgroundBack);             //最下层
            this.AddChild(bacground);
            this.AddChild(middle);
            this.AddChild(front);

            LeftLimit  = -Width * 0.5f;
            RightLimit = Width * 0.5f;
            UpLimit    = -Heigth * 0.5f;
            DownLimit  = Heigth * 0.5f;

            map          = new BattleMap(bacgroundBack);
            enemy        = new BEnemyManager(middle, this);
            player       = new BPlayer(middle, this);
            otherSprites = new SpriteX(this, "Battles//test.png", new Vector2(0, 0));
            otherSprites.CenterSprite(TRS.Local.Center);

            //锁定
            player.SetCanLockEnemys(enemy.GetAllWarships());
            enemy.SetCanLockEnemys(player.GetAllWarships());

            base.Start();
        }
コード例 #2
0
        public override void Start()
        {
            //先加载资源
            GameData.LoadTextureInfo("Battles//background.png");
            GameData.LoadTextureInfo("Battles//BoundaryWarning.png");
            GameData.LoadTextureInfo("Battles//primitive.png");
            GameData.LoadTextureInfo("Battles//star.png");
            GameData.LoadTextureInfo("Battles//test.png");
            GameData.LoadTextureInfo("Battles//testship.png");
            GameData.LoadTextureInfo("Battles//testwingman.png");

            bacgroundBack = new Layer ();
            bacground = new Layer ();
            middle = new Layer ();
            front = new Layer ();

            this.AddChild (bacgroundBack);//最下层
            this.AddChild (bacground);
            this.AddChild (middle);
            this.AddChild (front);

            LeftLimit = - Width * 0.5f;
            RightLimit = Width * 0.5f;
            UpLimit = - Heigth * 0.5f;
            DownLimit = Heigth * 0.5f;

            map = new BattleMap(bacgroundBack);
            enemy = new BEnemyManager(middle,this);
            player = new BPlayer(middle,this);
            otherSprites = new SpriteX (this, "Battles//test.png", new Vector2 (0, 0));
            otherSprites.CenterSprite (TRS.Local.Center);

            //锁定
            player.SetCanLockEnemys(enemy.GetAllWarships());
            enemy.SetCanLockEnemys(player.GetAllWarships());

            base.Start ();
        }