/* <Monster> CreateMonster(Design _design, int _x, int _y, string _name) * Creates a Monster at a given randomPosition; */ /// <summary> /// Create a Monster out of a given Design at a given position. /// </summary> /// <param name="_design">The Design</param> /// <param name="_x">The x-Coordinate of the position</param> /// <param name="_y">The y-Coordinate of the position</param> /// <param name="_name">The name displayed at the end of the game.</param> /// <returns></returns> public static Monster CreateMonster(Design _design, int _x, int _y, string _name) { Monster monster = new Monster { outfit = _design, name = _name, pos_x = _x, pos_y = _y, }; monster.parts = _design.designElements; return(monster); }
public void CreateEnemyFromDesign(Design _design, string _name, bool _everywhere) { randomPosition = RandomStartPos(_everywhere); //monster = new Monster //{ outfit = _design; // , name = _name; //, pos_x = randomPosition[0]; //, // Program.x / 3, pos_y = randomPosition[1]; //, // (Program.y + Program.top) / 2, parts = _design.designElements; //}; // return monster; }
/// <summary> /// Create an asDancer different from Player /// </summary> /// <remarks>Set asDancer start randomPosition to random randomPosition</remarks> /// <param name="_player">The player monster</param> /// <returns>Returns a monster different than parameter</returns> public static Monster CreateEnemy(Player _player) { // get the design of player // and select a different one int id = 0; Design enemyDesign = Game.theDesigns[id]; while (enemyDesign.designName == _player.outfit.designName) { id = Game.rndm.Next(Game.theDesigns.Length - 1); enemyDesign = Game.theDesigns[id]; } // store a random start randomPosition int[] here = RandomStartPos(); Monster enemy = Player.CreateMonster(enemyDesign, here[0], here[1], "The incredible " + enemyDesign.designName); return(enemy); }
public Enemy(Player _player) { // get the design of player // and select a different one int id = 0; Design enemyDesign = Game.theDesigns[id]; while (enemyDesign.designName == _player.outfit.designName) { id = Game.rndm.Next(Game.theDesigns.Length - 1); enemyDesign = Game.theDesigns[id]; } this.outfit = enemyDesign; // store a random start randomPosition int[] here = RandomStartPos(); this.pos_x = here[0]; this.pos_y = here[1]; this.name = "The incredible " + enemyDesign.designName; }
// public Enemy(Design _design, string _name, bool _everywhere) { this.CreateEnemyFromDesign(_design, _name, _everywhere); }
/// <summary> /// Init the game. /// Set concole size and color. /// Set the layout of the monster. /// </summary> public static void InitGame() { // set screen to default // Console Settings Console.Clear(); Console.WindowWidth = Window.x; Console.WindowHeight = Window.y; Console.BufferWidth = Window.x; Console.BufferHeight = Window.y; Console.BackgroundColor = ConsoleColor.Black; #region Monster design // Monster Designs; /* | Goble Frodo Angry | | (° °) {0.0} [-.-] | | ~▓~ o-▓-o '▓' | ] [ { } U U | */ Game.goble = new Design { designName = "Goble", designColor = ConsoleColor.White, designElements = new string[] { "(°;°)", " ~▓~ ", " ] [ ", "O-▓-O" }, FightSound = Sound.low, // top resistance: 30 // medium speed: 888 stats = new Stats { hPoints = 500, aPoints = 40, dPoints = 30, sPoints = 888, } }; Game.frodo = new Design { designName = "Frodo", designColor = ConsoleColor.Yellow, designElements = new string[] { "{O.O}", " /▓\\ ", " { } ", "o-▓-o" }, FightSound = Sound.mid, // low resistance: 10 // high speed: 555 stats = new Stats { hPoints = 500, aPoints = 50, dPoints = 10, sPoints = 555, } }; Game.angry = new Design { designName = "Angro", designColor = ConsoleColor.Green, designElements = new string[] { "[-.-]", " '▓' ", " U U ", "0-▓-0" }, FightSound = Sound.high, // medium resistance: 20 // low speed: 1111 stats = new Stats { hPoints = 500, aPoints = 60, dPoints = 20, sPoints = 1111, // less is faster }, }; #endregion Game.theDesigns = new Design[] { Game.goble, Game.frodo, Game.angry }; }
public void InitDancer(Design design, string title) { asDancer = new Enemy(design, title, true); // asDancer.CreateEnemyFromDesign(design, title, true); // asDancer.monster.parts = design.designElements; }