#include "color_palette.h" #include void set_pairs() { init_pair(2, COLOR_BLUE, COLOR_BLUE); init_pair(3, COLOR_YELLOW, COLOR_BLACK); init_pair(4, COLOR_MAGENTA, COLOR_MAGENTA); init_pair(5, COLOR_YELLOW, COLOR_BLACK); init_pair(6, COLOR_RED, COLOR_BLACK); init_pair(7, COLOR_BLUE, COLOR_BLACK); init_pair(8, COLOR_MAGENTA, COLOR_BLACK); init_pair(9, COLOR_BLUE, COLOR_WHITE); } void paint_field_element(int element) { int color; switch(element) { case block: color = COLOR_PAIR(2); break; case coin: color = COLOR_PAIR(3) | A_BOLD; break; case door: color = COLOR_PAIR(4); break; } attrset(color); } void paint_stats() { attrset(COLOR_PAIR(5)); } void paint_ghost(enum ghost_color color, int frightened_counter, int prison_status) { int attr; if(frightened_counter && !prison_status) { attr = COLOR_PAIR(9); attrset(attr); return; } switch(color) { case red: attr = COLOR_PAIR(6); break; case pink: attr = COLOR_PAIR(8); break; case blue: attr = COLOR_PAIR(7); break; case orange: attr = COLOR_PAIR(3); } attrset(attr); } void paint_pac() { attrset(COLOR_PAIR(3) | A_BOLD); } void paint_hit() { attrset(COLOR_PAIR(6)); } void reset_attr() { attrset(A_NORMAL); }