Esempio n. 1
0
void check_if_bumped(int y, int x) {
    int i;
 
    for (i = 0; i <= store.starcount; i++) {
            if (y == store.plant1[i] && x == store.plant2[i]) {
                mvprintw(y, x, aircraft.ship, A_BOLD);
                change_colors(COLOR_RED);
                getch();
                hud.power--;  
                }
        
    }
    change_colors(COLOR_WHITE);
    check_if_dead(y, x);
}
Esempio n. 2
0
void	play_loop(t_share *shared, t_player *player)
{
	usleep(TIME);
	lock();
	if (shared->kill == TRUE)
	{
		if (shared->nb_team == 1)
		{
			unlock();
			shared->end = TRUE;
		}
	}
	if (check_if_dead(shared, player) == -1)
	{
		shared->kill = TRUE;
		unlock();
		return ;
	}
	find_enemy(shared, player);
	move(shared, player);
	unlock();
}