|
@@ -70,7 +70,7 @@ int main(int argc,char** argv)
|
|
|
double shootrate; //probability of an enemy shooting a bomb
|
|
|
int command; //keyboard input
|
|
|
int score=0; //score: gain +100 when an enemy is destroyed and +50 when a bomb is destroyed
|
|
|
- char level='1'; //difficulty level
|
|
|
+ int level=1; //difficulty level
|
|
|
|
|
|
create_std_bosses();
|
|
|
std::string bossname1=getenv("HOME");
|
|
@@ -134,11 +134,12 @@ int main(int argc,char** argv)
|
|
|
for(w_vec::iterator it=walls.begin(); it!=walls.end(); ++it, ++i) //creating walls (in a quite symmetric pattern)
|
|
|
it->create((i+1)*(C/(3*WALLS_NUM+1))+i*(2*C/(3*WALLS_NUM+1)),2*R/3,(int)min(6,2*C/(3*WALLS_NUM+1)),2,3);
|
|
|
|
|
|
- choose_level_bossrush(shootrate,refresh_time,level,commands);
|
|
|
+ level = choose_level_bossrush(commands);
|
|
|
+ setup_level_bossrush(level, shootrate, refresh_time);
|
|
|
|
|
|
player1.set_commands(commands);
|
|
|
|
|
|
- if(atoi(&level)<3)
|
|
|
+ if(level<3)
|
|
|
player1.weaponclass=2;
|
|
|
|
|
|
erase();
|
|
@@ -230,7 +231,7 @@ int main(int argc,char** argv)
|
|
|
|
|
|
if(boss1.health<=0)
|
|
|
if(num<4){
|
|
|
- score+=250*atoi(&level)*(num+1);
|
|
|
+ score+=250*level*(num+1);
|
|
|
for(int i=max(0,boss1.y-1);i<min(R-1,boss1.y+boss1.height+1);i++)
|
|
|
for(int j=0;j<C;j++)
|
|
|
mvaddch(i,j,' ');
|
|
@@ -274,11 +275,12 @@ int main(int argc,char** argv)
|
|
|
score=0;
|
|
|
erase();
|
|
|
refresh();
|
|
|
- choose_level_bossrush(shootrate, refresh_time,level,commands);
|
|
|
+ level = choose_level_bossrush(commands);
|
|
|
+ setup_level_bossrush(level, shootrate, refresh_time);
|
|
|
reset(player1, enemies, boss1, bullets, bombs, walls, powerups,rockets, level,chflag); // reset box, player, enemy and deletes all bullets and bombs
|
|
|
resetbosses(bosses,boss1,player1);
|
|
|
num=0;
|
|
|
- if(atoi(&level)<3)
|
|
|
+ if(level<3)
|
|
|
player1.weaponclass=2;
|
|
|
erase();
|
|
|
refresh();
|
|
@@ -308,11 +310,12 @@ int main(int argc,char** argv)
|
|
|
score=0;
|
|
|
erase();
|
|
|
refresh();
|
|
|
- choose_level_bossrush(shootrate, refresh_time, level,commands);
|
|
|
+ level = choose_level_bossrush(commands);
|
|
|
+ setup_level_bossrush(level, shootrate, refresh_time);
|
|
|
reset(player1, enemies, boss1, bullets, bombs, walls, powerups,rockets, level,chflag); // reset box, player, enemy and delete all bullets and bombs
|
|
|
resetbosses(bosses,boss1,player1);
|
|
|
num=0;
|
|
|
- if(atoi(&level)<3)
|
|
|
+ if(level<3)
|
|
|
player1.weaponclass=2;
|
|
|
erase();
|
|
|
refresh();
|