Exemplo n.º 1
0
void create_new_ghost()
{
    GHOST ghost;
    init_ghost(&ghost);
    while(1)
    {
        move_ghost(&ghost);
        sleep(ghost_sleep);
    }
}
Exemplo n.º 2
0
void create_new_ghost()
{
    GHOST ghost;
    int dx, dy;

    init_ghost(&ghost);
    choose_random_direction(&dx, &dy);
    
    while (1) {
	    sleep(10);
	    while (move_ghost(&ghost, dx, dy) == FALSE) {
	        choose_random_direction(&dx, &dy);
        }
    }
}