private static void DisplayAsync() { string text = Story.TransitionTexts[_mapLevel - 1]; _UIConsole.Resize(_screenWidth, _screenHeight); _UIConsole.Clear(); _UIConsole.SetChar(1, 5, '_'); int i = 1; int j = 5; foreach (char letter in text) { _UIConsole.SetChar(i, j, letter); _UIConsole.SetChar(i + 1, j, '_'); RLConsole.Blit(_UIConsole, 0, 0, _UIConsole.Width, _UIConsole.Height, _rootConsole, 0, 0); _rootConsole.Draw(); if (letter == '.') { Thread.Sleep(500); } Thread.Sleep(Dice.Roll("3D30")); i++; if (i >= _UIConsole.Width - 3) { _UIConsole.SetChar(i, j, ' '); j += 2; i = 1; } } Thread.Sleep(1000); }
// Draws the walls around a width by height room, counting the walls public static void CreateRoomWalls(int topLeftX, int topLeftY, int width, int height, int verticalChar, int horizontalChar, int topLeftCornerChar, int topRightCornerChar, int bottomLeftCornerChar, int bottomRightCornerChar, RLConsole console) { // Top left corner console.SetChar(topLeftX, topLeftY, topLeftCornerChar); // Top right corner console.SetChar(topLeftX + width - 1, topLeftY, topRightCornerChar); // Top line console.SetChar(topLeftX + 1, topLeftY, width - 2, 1, horizontalChar); // Bottom line console.SetChar(topLeftX + 1, topLeftY + height - 1, width - 2, 1, horizontalChar); // Left line console.SetChar(topLeftX, topLeftY + 1, 1, height - 2, verticalChar); // Right line console.SetChar(topLeftX + width - 1, topLeftY + 1, 1, height - 2, verticalChar); // Bottom left corner console.SetChar(topLeftX, topLeftY + height - 1, bottomLeftCornerChar); // Bottom right corner console.SetChar(topLeftX + width - 1, topLeftY + height - 1, bottomRightCornerChar); }
/// <summary> /// Clears the entity symbol. /// </summary> /// <param name="console"></param> private void clear(RLConsole console) { console.SetChar(pos.x, pos.y, ' '); }
/// <summary> /// The draw method of the entity. /// You need to pass the subconsole it is being drawn onto. /// </summary> /// <param name="console"></param> private void draw(RLConsole console) { console.SetChar(pos.x, pos.y, character); }