/// <summary> /// Constructor of the class Renderer /// </summary> /// <param name="level"> The current room layout </param> /// <param name="player"> The player </param> public Renderer(RoomGenerator level, Player player, int lvl) { // Saves the level given to the one created this.lvl = lvl; // Saves the room layout given this.level = level; // Saves the player given this.player = player; // Calculates the initial HP of the player initialHP = ((level.SizeX - 3) * (level.SizeY - 2)) / 4; // Rests the color of the console Console.ResetColor(); // Hides the cursor while drawing Console.CursorVisible = false; // Clears the console Console.Clear(); // Creates an Array of all the Piece allVisuals = new Piece[] { Piece.Block, Piece.Boss, Piece.Enemy, Piece.Exit, Piece.Player, Piece.PowerMax, Piece.PowerMed, Piece.PowerMin }; // Draws the level information once DrawLevelUI(); }
/// <summary> /// This creates the player /// He's HP requires the number of <see cref="rows"/> and /// <see cref="columns"/> /// </summary> /// <param name="rows">Number of rows</param> /// <param name="columns">Number of columns</param> /// <param name="Room">With Room is in</param> /// <param name="rnd">Random position</param> public Player(int rows, int columns, RoomGenerator Room, int rnd) { HP = (rows * columns) / 4; Position = new Position(1, rnd); Type = Piece.Player; this.Room = Room; MaxHP = HP; }
/// <summary> /// Constructor of the scene /// </summary> /// <param name="row"> The wanted number of rows </param> /// <param name="col"> The wanted number of columns </param> public SceneManager(int row, int col) { // Sets the variables in this class to the ones given this.col = col; this.row = row; // Generates a new Random rnd = new Random(); // Generates a new Level Room = new RoomGenerator(); }