diff --git a/Level_1.jpg b/Level_1.jpg new file mode 100644 index 0000000..e8c0dc5 Binary files /dev/null and b/Level_1.jpg differ diff --git a/Level_2.jpg b/Level_2.jpg new file mode 100644 index 0000000..a2cb81f Binary files /dev/null and b/Level_2.jpg differ diff --git a/Level_3.jpg b/Level_3.jpg new file mode 100644 index 0000000..76baf15 Binary files /dev/null and b/Level_3.jpg differ diff --git a/README.md b/README.md index d4130b9..fb16c8b 100644 --- a/README.md +++ b/README.md @@ -26,8 +26,9 @@ All contributions are welcome. ### :gear: Compiling and running 1. `cd Shooting-Game` 2. `make` -3. `./ShootingGame [number of AI enemies]` -*Note: If the argument is omitted, it will default to 4 AI enemies.* +3. `./ShootingGame [number of AI enemies][Level]` +*Note: If the argument 2 is omitted, it will default to 4 AI enemies.* +*Note: If the argument 3 is omitted, it will default to Level 3.* ## Windows 1. Install Ubuntu. :sweat_smile: 2. See above. diff --git a/main.cpp b/main.cpp index 00b3e8f..8143e2f 100644 --- a/main.cpp +++ b/main.cpp @@ -59,11 +59,33 @@ int main(int argc, char *argv[]) int dead=0; activeChars.push_back(p); start = clock(); - if(argc == 2) + if(argc >= 2) { stringstream inp(argv[1]); inp>>aiPlayers; } + if(argc >= 3) + { + stringstream inp(argv[2]); + int x; + inp>>x; + Mat temp; + switch(x) + { + case 1: + temp=imread("Level_1.jpg",1); + imwrite("map.jpg",temp); + break; + case 2: + temp=imread("Level_2.jpg",1); + imwrite("map.jpg",temp); + break; + default: + temp=imread("Level_3.jpg",1); + imwrite("map.jpg",temp); + break; + } + } for(int i=0; i