Erwan
- Reward system in Story mode (currently, either credits or random set) - Rules now accept for player 2 to start (see story mode "block" stage) - Story mode now has an autosave/autoload mechanism. This is for convenience but also to prevent people from abusing the reward mechanism too easily. - possibility to choose an avatar for both players through the rules (see example in story mode)
This commit is contained in:
@@ -29,6 +29,19 @@ Player::~Player(){
|
||||
mAvatarTex = NULL;
|
||||
}
|
||||
|
||||
void Player::loadAvatar(string file){
|
||||
if (mAvatarTex) {
|
||||
resources.Release(mAvatarTex);
|
||||
mAvatar = NULL;
|
||||
mAvatarTex = NULL;
|
||||
}
|
||||
mAvatarTex = resources.RetrieveTexture(file,RETRIEVE_LOCK,TEXTURE_SUB_AVATAR);
|
||||
if (mAvatarTex)
|
||||
mAvatar = resources.RetrieveQuad(file,0,0,35,50,"playerAvatar",RETRIEVE_NORMAL,TEXTURE_SUB_AVATAR);
|
||||
else
|
||||
mAvatar = NULL;
|
||||
}
|
||||
|
||||
const string Player::getDisplayName() const {
|
||||
GameObserver * g = GameObserver::GetInstance();
|
||||
if (this == g->players[0]) return "Player 1";
|
||||
@@ -58,11 +71,7 @@ Player * Player::opponent(){
|
||||
}
|
||||
|
||||
HumanPlayer::HumanPlayer(MTGPlayerCards * deck, string file, string fileSmall) : Player(deck, file, fileSmall) {
|
||||
mAvatarTex = resources.RetrieveTexture("avatar.jpg",RETRIEVE_LOCK,TEXTURE_SUB_AVATAR);
|
||||
if (mAvatarTex)
|
||||
mAvatar = resources.RetrieveQuad("avatar.jpg",0,0,35,50,"playerAvatar",RETRIEVE_NORMAL,TEXTURE_SUB_AVATAR);
|
||||
else
|
||||
mAvatar = NULL;
|
||||
loadAvatar("avatar.jpg");
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user