const int landermax = 12;
const int crawlermax = 6;
const int missilemax = 3;
-const float version = 1.04;
+const float version = 1.05;
int score;
int lives;
//alerts
if(alertright>0){
if(alertright%2==0){
- warningchannel = play_sound_effect(warningsound);
+ warningchannel = play_sound_effect(warningsound, warningchannel);
mvprintw(19,50," >> ");
};
alertright--;
};
if(alertleft>0){
if(alertleft%2==0){
- warningchannel = play_sound_effect(warningsound);
+ warningchannel = play_sound_effect(warningsound, warningchannel);
mvprintw(19,40," << ");
};
alertleft--;
if(shieldup==0){
if(shieldsleft>=1){
shieldup=1;
- shieldupchannel = play_sound_effect(shieldupsound);
+ shieldupchannel = play_sound_effect(shieldupsound, shieldupchannel);
};
} else {
shieldup=0;
- shielddownchannel = play_sound_effect(shielddownsound);
+ shielddownchannel = play_sound_effect(shielddownsound, shielddownchannel);
};
};
shieldsleft--;
} else {
shieldup=0;
- shielddownchannel = play_sound_effect(shielddownsound);
+ shielddownchannel = play_sound_effect(shielddownsound, shielddownchannel);
};
};
//check for powerup pickup
for(int puploop = 0; puploop<4; puploop++){
if((powerups[puploop].active==1)&&(check_collision(powerups[puploop], player)==1)){
- puptakechannel = play_sound_effect(puptakesound);
+ puptakechannel = play_sound_effect(puptakesound, puptakechannel);
powerups[puploop] = object_out(powerups[puploop]);
if(strncmp(powerups[puploop].line0, "T", 1)==0){
tripshot = tripshot + 100;
//check for / process pod pickup
for(int podloop = 0; podloop<podmax; podloop++){
if((pod_in==0)&&(pods[podloop].active==1)&&(check_collision(pods[podloop], player)==1)){
- pickupchannel = play_sound_effect(pickupsound);
+ pickupchannel = play_sound_effect(pickupsound, pickupchannel);
pod_in = pods[podloop].number;
pods[podloop].chase = -1;
//stop the chase if we steal the pod
//if pod in hand, check for gate dropoff
if(pod_in>0){
if((abs(player.y-gate.y)<player.speed)&&(player.x>10)){
- dropoffchannel = play_sound_effect(dropoffsound);
+ dropoffchannel = play_sound_effect(dropoffsound, dropoffchannel);
//set pod inactive
for(int podloop = 0; podloop<podmax; podloop++){ if(pod_in==pods[podloop].number){ pods[podloop] = object_out(pods[podloop]); }; };
//if laser, do that
if(laser>0){
drawlaser=1;
- laserchannel = play_sound_effect(lasersound);
+ laserchannel = play_sound_effect(lasersound, laserchannel);
//kill landers
for(int landerloop = 0; landerloop<landermax; landerloop++){
if(((abs(player.y-landers[landerloop].y)<=80)||(abs(player.y-landers[landerloop].y)>=540))&&(player.x==landers[landerloop].x)&&((player.face==0&&(landers[landerloop].y<player.y))||(player.face==1&&(landers[landerloop].y>player.y)))){
laser--;
} else {
//shot sound
- if(sound==1){shotchannel = play_sound_effect(shotsound);};
+ if(sound==1){shotchannel = play_sound_effect(shotsound, shotchannel);};
//get next inactive bullet, give it player's direction, speed, height, location +speed in direction, active.
for(int bulletloop = 0; bulletloop<bulletmax; bulletloop++){
if(bullets[bulletloop].active==0){
if(missiles[missileloop].chase==-1){
missiles[missileloop].chase = landerloop;
//play missle launch sound
- missilechannel = play_sound_effect(missilesound);
+ missilechannel = play_sound_effect(missilesound, missilechannel);
//init missle
missiles[missileloop] = missile_init(missiles[missileloop], player, landers[landerloop]);
missile--;
bosscount = 0;
for(int bossloop = 0; bossloop<6; bossloop++){ bosscount = bosscount + bosses[bossloop].active; };
if(landercount<=0&&bosscount<=0){
- levelendchannel = play_sound_effect(levelendsound);
+ levelendchannel = play_sound_effect(levelendsound, levelendchannel);
//Tally bonuses
//Award lives, if any
if(lives<4){lives++;};