オブジェクトを一括管理する
예제 #1
0
        ///以下、BulletMLLibに必要なインターフェイスを実装します

        /// <summary>
        /// 新しい弾(Mover)を作成するときライブラリから呼ばれる
        /// </summary>
        public BulletMLBullet GetNewBullet()
        {
            bulletRoot = true;
            Mover mover = MoverManager.CreateMover();

            return(mover.mlBullet);
        }
예제 #2
0
        protected override void Update(GameTime gameTime)
        {
            if (Keyboard.GetState().IsKeyDown(Keys.Escape))
            {
                this.Exit();
            }
            timer++;
            if (timer > 60)
            {
                timer = 0;
                if (mover.used == false)
                {
                    //敵を一つ画面中央に作成し、弾を吐くよう設定
                    mover     = MoverManager.CreateMover();
                    mover.pos = new Vector2(graphics.PreferredBackBufferWidth / 4 + graphics.PreferredBackBufferWidth / 2 * (float)rand.NextDouble(), graphics.PreferredBackBufferHeight / 2 * (float)rand.NextDouble());
                    mover.SetBullet(parser.tree); //BulletMLで動かすように設定
                }
            }

            //すべてのMoverを行動させる
            MoverManager.Update();
            //使わなくなったMoverを解放
            MoverManager.FreeMovers();
            // 自機を更新
            myship.Update();

            base.Update(gameTime);
        }
예제 #3
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

            texture = Content.Load <Texture2D>("Sprites\\bullet");
            parser.ParseXML(@"Content\xml\sample.xml"); ///BulletMLを解析
            //parser.ParseXML(@"Content\xml\[1943]_rolling_fire.xml");
            //parser.ParseXML(@"Content\xml\[Guwange]_round_2_boss_circle_fire.xml");
            //parser.ParseXML(@"Content\xml\[Guwange]_round_3_boss_fast_3way.xml");
            //parser.ParseXML(@"Content\xml\[Guwange]_round_4_boss_eye_ball.xml");
            //parser.ParseXML(@"Content\xml\[G_DARIUS]_homing_laser.xml");
            //parser.ParseXML(@"Content\xml\[Progear]_round_1_boss_grow_bullets.xml");
            //parser.ParseXML(@"Content\xml\[Progear]_round_2_boss_struggling.xml");
            //parser.ParseXML(@"Content\xml\[Progear]_round_3_boss_back_burst.xml");
            //parser.ParseXML(@"Content\xml\[Progear]_round_3_boss_wave_bullets.xml");
            //parser.ParseXML(@"Content\xml\[Progear]_round_4_boss_fast_rocket.xml");
            //parser.ParseXML(@"Content\xml\[Progear]_round_5_boss_last_round_wave.xml");
            //parser.ParseXML(@"Content\xml\[Progear]_round_5_middle_boss_rockets.xml");
            //parser.ParseXML(@"Content\xml\[Progear]_round_6_boss_parabola_shot.xml");
            //parser.ParseXML(@"Content\xml\[Psyvariar]_X-A_boss_opening.xml");
            //parser.ParseXML(@"Content\xml\[Psyvariar]_X-A_boss_winder.xml");
            //parser.ParseXML(@"Content\xml\[Psyvariar]_X-B_colony_shape_satellite.xml");
            //parser.ParseXML(@"Content\xml\[XEVIOUS]_garu_zakato.xml");
            //BulletMLの初期化
            BulletMLManager.Init(new MyBulletFunctions());

            //敵を一つ画面中央に作成し、弾を吐くよう設定
            mover     = MoverManager.CreateMover();
            mover.pos = new Vector2(graphics.PreferredBackBufferWidth / 2, graphics.PreferredBackBufferHeight / 2);
            mover.SetBullet(parser.tree); //BulletMLで動かすように設定
        }
예제 #4
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);

            Content.RootDirectory = "Content";
            myship = new Myship();

            //_clock = new GameClock();
            //_inputState = new InputState();
            //_inputWrapper = new InputWrapper(new ControllerWrapper(PlayerIndex.One, true), _clock.GetCurrentTime);
            //_inputWrapper.Controller.UseKeyboard = true;
            _moverManager = new MoverManager(myship.Position);
        }
예제 #5
0
 public void setupHarness()
 {
     dude = new Myship();
     manager = new MoverManager(dude.Position);
     pattern = new BulletPattern();
 }
예제 #6
0
 public void setupHarness()
 {
     dude = new Myship();
     manager = new MoverManager(dude.Position);
 }