};
}
+int play_sound_effect(Mix_Chunk *chunk){
+ int channel = Mix_PlayChannel(-1, chunk, 0);
+ return channel;
+};
+
+void boom_object_test(game_object boomstuff, game_object object, Mix_Chunk *sound, int channel){
+ int deathcycle=1;
+ int loop=1;
+ boomstuff.active=1;
+ channel = play_sound_effect(sound);
+ while(deathcycle<=7){
+ for(int boomx=object.x-10;boomx<=object.x+10;boomx++){
+ for(int boomy=object.y-10;boomy<=object.y+10;boomy++){
+ if(sqrt((abs(object.y-boomy)*abs(object.y-boomy))+(abs(object.x-boomx)*abs(object.x-boomx)))<=deathcycle){
+ if(rand()%1000>900){
+ boomstuff.x = boomx;
+ boomstuff.y = boomy;
+ if(rand()%1000>500){
+ boomstuff.face = 0;
+ } else {
+ boomstuff.face = 1;
+ };
+ for(int iterations=0;iterations<=loop;iterations++){
+ drawlocation = draw_object(boomstuff, drawlocation);
+ };
+ //get the cursor out of the way
+ mvprintw(23,79,"-");
+ refresh();
+ };
+ };
+ };
+ };
+ deathcycle++;
+ };
+ if(object.number!=1){
+ usleep(50000);
+ };
+}
+
int life_loss(int lives, int score){
if(lives>=1){
pause_game = 0;
};
-int play_sound_effect(Mix_Chunk *chunk){
- int channel = Mix_PlayChannel(-1, chunk, 0);
- return channel;
-};
-
game_object player_init(game_object player){
player.x = 18;
player.y = rand()%600+20;
exit(1);
}
-
if(stat("data/boom.ogg", &datatest)==0){
shotsound = Mix_LoadWAV("data/shot.ogg");
boomsound = Mix_LoadWAV("data/boom.ogg");
if(check_collision(bullets[bulletloop], landers[landerloop])==1){
//kill lander and bullet
determine_powerup(powerups, landers[landerloop], 800);
- if(sound==1){boomchannel = play_sound_effect(boomsound);};
- boom_object(boomstuff, landers[landerloop]);
+ //if(sound==1){boomchannel = play_sound_effect(boomsound);};
+ boom_object_test(boomstuff, landers[landerloop], boomsound, boomchannel);
landers[landerloop] = object_out(landers[landerloop]);
bullets[bulletloop].vtime = 100;
bullets[bulletloop] = age_bullet(bullets[bulletloop]);