Example #1
0
        static void Main(string[] args)
        {
            Player player = new Player();
            Enemy  enemy  = new Enemy();

            Potion potion = new Potion();
            Stuff  stuff  = new Stuff();



            player = new Player("Player", 300, 23, 0.3f);
            enemy  = new Enemy("Enemy", 100, 13, 0.3f);
            while (player.HP > 0 && enemy.HP > 0)
            {
                player.Attak(enemy);
                enemy.Attak(player);
                stuff.potionuse();
                Console.ReadLine();
            }



            /*int hpplayer = 10; //玩家血量
             * int attakplayer = example.Next(2,5);  //玩家攻击力
             * float exple = 0.3f;  //玩家暴击几率
             * int explehurt = 4;   //玩家暴击伤害
             *
             * int hpenemy = 8; // 敌人血量
             * int attakenemy = example.Next(2,4); // 敌人攻击力
             * int exp = 100; //升级需要的经验值
             * int level = 1; // 玩家的等级
             *
             *
             * while (hpplayer > 0 && hpenemy > 0)
             * {
             *  Console.WriteLine("玩家血量为:{0} \n 怪物血量为:{1}", hpplayer, hpenemy);
             *  hpplayer -= attakenemy;
             *  Console.WriteLine("玩家受到{0}伤害,血量:{1}", attakenemy,hpplayer);
             *  hpenemy -= attakplayer;
             *  Console.WriteLine("怪物受到{0}伤害,血量:{1}", attakplayer, hpenemy);
             *
             *  Console.ReadLine();
             * }
             * if(hpplayer <=0 )
             * Console.WriteLine("玩家死了,游戏结束");
             * if(hpenemy <=0)
             * Console.WriteLine("敌人死了,游戏结束");
             * //int es1 = hpplayer - attakenemy; // 玩家被攻击
             * //int es2 = hpenemy - attakplayer; // 敌人被攻击*/
        }