-
Notifications
You must be signed in to change notification settings - Fork 0
/
curses.c
executable file
·50 lines (42 loc) · 1.06 KB
/
curses.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include <ncurses.h>
#include "map.h"
#include <string.h>
void initBoard(){
init_pair(1, COLOR_BLACK, COLOR_GREEN);
init_pair(2, COLOR_BLACK, COLOR_RED);
init_pair(3, COLOR_BLACK, COLOR_BLUE);
init_pair(4, COLOR_BLACK, COLOR_WHITE);
init_pair(5, COLOR_BLACK, COLOR_CYAN);
//background team A (red)
for(int i = 70; i < 80; i++){
for(int j = 1; j <= 10; j++){
attron(COLOR_PAIR(2));
mvprintw(j, i, " ");
}
}
//background team B (blue)
for(int i = 70; i < 80; i++){
for(int j = 11; j <= 20; j++){
attron(COLOR_PAIR(3));
mvprintw(j, i, " ");
}
}
//description area (scrollable)
for(int i = 0; i < 80; i++){
for(int j = 21; j < 24; j++){
attron(COLOR_PAIR(4));
mvprintw(j, i, " ");
}
}
}
int main(int argc, char* argv[]){
initscr();/* Start curses mode */
start_color();
loadMap(argv[1]);
initBoard();/* creates play board */
//loadMap(argc, argv);
refresh();/* Print it on to the real screen */
getch();/* Wait for user input */
endwin();/* End curses mode */
return 0;
}