-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implemented an in-game store #49 #53
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just some minor things I would change
Turn/src/Store.cpp
Outdated
{ | ||
ClearScreen(); | ||
coins = _Player->GetCoins(); | ||
cout << endl << " Jeremy's Tools Store\tPlayer: "; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest that Player::DisplayInventory
is called here instead of just printing the player's coins. This way they know what it is in their inventory when they're buying something.
Turn/src/Store.cpp
Outdated
_Player->AddStoreItemToInventory(ITEMTYPE::BOMB); | ||
_Player->LoseCoins(bombCost); | ||
} | ||
Sleep(1000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use SLEEP_MS instead of a magic number. Same thing for the other cases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done all the changes suggested
Turn/src/Store.cpp
Outdated
cout << " 0) Exit" << endl << endl; | ||
cout << " -------------------------------------------- " << endl << endl; | ||
cout << " What do you want to buy today?" << endl << endl << " "; | ||
cin >> choice; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice if choice = input();
is used instead
Turn/src/Store.cpp
Outdated
const unsigned short whetstoneCost = 20; | ||
|
||
//Messages | ||
string lowCoinsMessage = " Insufficient Coins !"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These strings should be constant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should i move all the const values such as Cost and Messages to common.h and common.cpp ?
Nice work @sarthi92, thank you for making the game better 👍 |
Implemented Store