Skip to content
Snippets Groups Projects
draw_dungeon.cpp 5.86 KiB
#include <ncurses.h>
#include <cstdint>
#include <climits>
#include <cstdarg>
#include <cstring>

#include "draw_dungeon.h"

char monster_chars[] = "0123456789abcdef";

const char *win_string[] = {
"                                                                                ",
"                                                                                ",
"                                                                                ",
"                                                               *                ",
"                                      **                      ***               ",
"                                      **                       *                ",
"**   ****      ****   **   ****        **    ***    ****                        ",
" **    ***  * * ***  * **    ***  *     **    ***     ***  * ***   ***  ****    ",
" **     **** *   ****  **     ****      **     ***     ****   ***   **** **** * ",
" **      ** **    **   **      **       **      **      **     **    **   ****  ",
" **      ** **    **   **      **       **      **      **     **    **    **   ",
" **      ** **    **   **      **       **      **      **     **    **    **   ",
" **      ** **    **   **      **       **      **      **     **    **    **   ",
" **      ** **    **   **      **       **      **      *      **    **    **   ",
"  *********  ******     ******* **       ******* *******       **    **    **   ",
"    **** ***  ****       *****   **       *****   *****        *** * ***   ***  ",
"          ***                                                   ***   ***   *** ",
"   *****   ***                                                                  ",
" ********  **                                                                   ",
"*      ****                                                                     ",
"                                                                                ",
"                                                                                ",
"                                                                                "
};

const char *lose_string[] = {
"                                                                                ",
"                                                                                ",
"                                          ***                                   ",
"                                           ***                                  ",
"                                            **                                  ",
"                                            **                                  ",
"    **   ****      ****   **   ****         **     ****     ****                ",
"     **    ***  * * ***  * **    ***  *     **    * ***  * * **** *   ***       ",
"     **     **** *   ****  **     ****      **   *   **** **  ****   * ***      ",
"     **      ** **    **   **      **       **  **    ** ****       *   ***     ",
"     **      ** **    **   **      **       **  **    **   ***     **    ***    ",
"     **      ** **    **   **      **       **  **    **     ***   ********     ",
"     **      ** **    **   **      **       **  **    **       *** *******      ",
"     **      ** **    **   **      **       **  **    **  ****  ** **           ",
"      *********  ******     ******* **      **   ******  * **** *  ****    *    ",
"        **** ***  ****       *****   **     *** * ****      ****    *******     ",
"              ***                            ***                     *****      ",
"       *****   ***                                                              ",
"     ********  **                                                               ",
"    *      ****                                                                 ",
"                                                                                ",
"                                                                                ",
"                                                                                "
};

void init_screen() {
  // Initialize ncurses screen
  initscr();
  start_color();
  
  init_pair(COLOR_WHITE, COLOR_WHITE, COLOR_BLACK);
  init_pair(COLOR_BLUE, COLOR_BLUE, COLOR_BLACK);
  init_pair(COLOR_CYAN, COLOR_CYAN, COLOR_BLACK);