Beispiel #1
0
        /// <summary>
        /// 新しいインスタンスを作成します
        /// </summary>
        /// <param name="enemy">敵</param>
        /// <param name="equipment">装備</param>
        internal Game(EnemyHeader enemy, PlayerHeader equipment)
        {
            this.player = new Player(equipment);

            this.boss = new Enemy(enemy, player);

            this.battle       = 0;
            this.playerAttack = new List <AttackObject>();
            this.enemyAttack  = new List <AttackObject>();
            this.screen       = DX.MakeScreen(Game.WINDOW_R * 2, Game.WINDOW_R * 2);
        }
Beispiel #2
0
        /// <summary>
        /// 新しいインスタンスを作成します
        /// </summary>
        /// <param name="name">名前</param>
        /// <param name="circle">円</param>
        /// <param name="power">本体の攻撃力</param>
        /// <param name="maxHP">最大HP</param>
        /// <param name="player">自機</param>
        /// <param name="image">画像</param>
        internal Enemy(EnemyHeader h, Player player)
            : base(new Vec(Game.WINDOW_R, Game.WINDOW_R / 2), 0, new Image(DX.LoadGraph(h.image), h.r, new Vec(0, 1).Rad), new Vec(0, 1).Rad)
        {
            this.Name   = h.name;
            this.HP     = h.hp;
            this.MaxHp  = h.hp;
            this.player = player;
            this.IsHit  = true;
            this.Draw   = false;

            this.lua = Script.Instance.lua;

            var initFunc = (LuaFunction)((LuaTable)this.lua[h.className])["new"];

            this.luaObject = (LuaTable)initFunc.Call(this)[0];

            this.updateFunc  = (LuaFunction)this.luaObject["update"];
            this.drawFunc    = (LuaFunction)this.luaObject["draw"];
            this.disposeFunc = (LuaFunction)this.luaObject["dispose"];
        }
Beispiel #3
0
 /// <summary>
 /// タイトル画面、ゲーム画面等を場合に応じて呼び出します
 /// </summary>
 private static void Update()
 {
     if (Program.title != null)//タイトル画面なら
     {
         Program.title.Process();
         if (count % Config.Instance.FrameSkip == 0)
         {
             Program.title.Draw();
         }
         if (!Program.title.Need)
         {
             Program.title         = null;
             Program.equipmentMenu = new TreeMenu <PlayerHeader>(Program.ZIKI_MSG, Script.PlayerH);
         }
     }
     else if (Program.equipmentMenu != null)//装備選択画面なら
     {
         Program.equipmentMenu.Process();
         if (count % Config.Instance.FrameSkip == 0)
         {
             Program.equipmentMenu.Draw();
         }
         if (!Program.equipmentMenu.Need)
         {
             Program.equipment     = Program.equipmentMenu.Header;
             Program.equipmentMenu = null;
             Program.missionMenu   = new TreeMenu <EnemyHeader>("敵を選択して下さい。", Script.EnemyH);
         }
     }
     else if (Program.missionMenu != null)//敵選択画面なら
     {
         Program.missionMenu.Process();
         if (count % Config.Instance.FrameSkip == 0)
         {
             Program.missionMenu.Draw();
         }
         if (!Program.missionMenu.Need)
         {
             if (Program.missionMenu.Decision)
             {
                 Program.missionData = Program.missionMenu.Header;//ミッションデータ取得
                 Program.missionMenu = null;
                 Program.game        = new Game(Program.missionData, Program.equipment);
             }
             else
             {
                 Program.missionMenu   = null;
                 Program.equipmentMenu = new TreeMenu <PlayerHeader>(Program.ZIKI_MSG, Script.PlayerH);
             }
         }
     }
     else//ゲーム画面なら
     {
         Program.game.Process();
         if (count % Config.Instance.FrameSkip == 0)
         {
             Program.game.Draw();
         }
         if (!Program.game.Need)
         {
             DX.SetBackgroundColor(0, 0, 0);
             Program.game          = null;
             Program.equipmentMenu = new TreeMenu <PlayerHeader>(Program.ZIKI_MSG, Script.PlayerH);
         }
     }
     count++;
 }