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
|
int zombie_count=0;
int max_zombie=5;
ENTITY **zombie_test;
...
if(key[KEY_L]){
zombie_test=(ENTITY**)malloc(max_zombie*sizeof(ENTITY*));
//zombie_test=malloc(max_zombie*sizeof(ENTITY));
int i=0;
for(i=0;i<max_zombie;i++){
*(zombie_test+i)=(ENTITY*)malloc(sizeof(ENTITY));
create_enemy(&(zombie_test[i]));
}
}
{
int i;
for(i=0;i<zombie_count;i++){
if(*zombie_test==NULL){
(*zombie_test+i)->x+=distance_sprite_hero;
zombie_move(buffer,*zombie_test+i,&sprite,&speed,gravite,rectangles,distance_sprite_hero);
}
}
} |
Partager