void pintar_zona_explorada(pirata_t* pirata, uint x, uint y){ if(pirata->jugador->index == JUGADOR_A){ screen_pintar(0, C_BG_GREEN, y, x); } else { screen_pintar(0, C_BG_CYAN, y, x); } }
void pintar_pirata(uint pos_nueva, uint pos_orig, uint type){ int x_orig = 0, y_orig = 0; int x_nueva = 0, y_nueva = 0; game_lineal2xy(pos_nueva, &x_nueva, &y_nueva); game_lineal2xy(pos_orig , &x_orig , &y_orig); if (type == PIRATA_MINERO) { screen_pintar(77, C_FG_WHITE, y_nueva, x_nueva); screen_pintar(77, C_FG_DARK_GREY, y_orig, x_orig); } else { screen_pintar(69, C_FG_WHITE, y_nueva, x_nueva); screen_pintar(69, C_FG_DARK_GREY, y_orig, x_orig); } }
void screen_pintar_jugador(jugador_t *j) { uchar c = 'A' + j->index; uchar color = C_MAKE_BG(screen_color_jugador(j)) | C_FG_WHITE; screen_pintar(c, color, j->y+1, j->x); }
void screen_pintar_perro(perro_t *perro) { uchar c = screen_caracter_perro(perro->tipo); uchar color = C_MAKE_BG(screen_color_jugador(perro->jugador)) | C_FG_WHITE; screen_pintar(c, color, perro->y+1, perro->x); }
void screen_actualizar_reloj_global() { static uint reloj_global = 0; reloj_global = (reloj_global + 1) % reloj_size; screen_pintar(reloj[reloj_global], C_BW, 49, 79); }
void screen_pintar_rect(uchar letra, uchar color, int fila, int columna, int alto, int ancho) { int f, c; for (f = fila; f < fila + alto; f++) { for (c = columna; c < columna+ancho; c++) screen_pintar(letra, color, f, c); } }
void screen_pintar_reloj_perro(perro_t *perro) { jugador_t *j = perro->jugador; uint columna = j->index == JUGADOR_A ? POSICION_RELOJES_C_A : POSICION_RELOJES_C_B; uchar col_libre = C_BG_BLACK | screen_color_jugador(j); uchar c, col; if (perro->libre == TRUE) { c = 'X'; col = col_libre; } else { c = reloj[perro->indice_reloj]; col = C_BW; } screen_pintar('1' + perro->index, C_BW, POSICION_RELOJES_F , columna + perro->index * 2); screen_pintar( c, col, POSICION_RELOJES_F + 2, columna + perro->index * 2); }
void print(const char * text, uint x, uint y, unsigned short attr) { int i; for (i = 0; text[i] != 0; i++) { screen_pintar(text[i], attr, y, x); x++; if (x == VIDEO_COLS) { x = 0; y++; } } }
void game_pirata_habilitar_posicion(jugador_t *j, pirata_t *pirata, int x, int y) { uint pos = game_xy2lineal(x, y); if ( game_posicion_valida(x,y) && !posicion_mapeada(pos, j)){ mapear_posicion_equipo(j, pos); //mapeo la posicion a todos los piratas disponibles en ese momento pintar_zona_explorada(pirata, x, y); j->posiciones_descubiertas[j->ultima_posicion_descubierta] = pos; //la agrega a la tabla de posiciones descubiertas del jugador j->ultima_posicion_descubierta++; if( obtener_posicion_botin(pos) < BOTINES_CANTIDAD ) { screen_pintar(111, C_FG_DARK_GREY, y, x); game_pirata_inicializar(PIRATA_MINERO, j->index, game_lineal2xy_formato(pos)); } } }
void screen_actualizar_posicion_mapa(uint x, uint y) { uchar bg = C_BG_GREEN; uchar letra; uint valor = game_huesos_en_posicion(x,y); perro_t *perro = game_perro_en_posicion(x, y); if (perro != NULL) { letra = screen_caracter_perro(perro->tipo); } else if (valor > 0) { letra = screen_caracter_tesoro(valor); } else if ((jugadorA.x_cucha == x && jugadorA.y_cucha == y) || (jugadorB.x_cucha == x && jugadorB.y_cucha == y)) { letra = 'x'; } else { letra = screen_valor_actual(y+1, x); } screen_pintar(letra, bg | C_FG_BLACK, y+1, x); }
void screen_borrar_jugador(jugador_t *j) { screen_pintar('.', C_BG_GREEN | C_FG_BLACK, j->y+1, j->x); screen_actualizar_posicion_mapa(j->x, j->y); }
void screen_borrar_perro(perro_t *perro) { screen_pintar('.', C_BG_GREEN | C_FG_BLACK, perro->y+1, perro->x); //screen_actualizar_posicion_mapa(perro->x, perro->y); }