Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Level_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Level_2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Level_3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
24 changes: 23 additions & 1 deletion main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<aiPlayers; ++i)
activeChars.push_back(new AI);
namedWindow("Game",CV_WINDOW_AUTOSIZE|CV_GUI_NORMAL);
Expand Down
Binary file modified map.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.