- Timestamp:
- Jan 7, 2014, 1:07:36 AM (11 years ago)
- Branches:
- master
- Children:
- d05c484
- Parents:
- eb2ad4f
- Location:
- common
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
common/Player.cpp
reb2ad4f r6054f1e 206 206 } 207 207 208 void Player::takeDamage(int damage) { 209 this->health -= damage; 210 if (this->health < 0) 211 this->health = 0; 212 if (this->health == 0) { 213 cout << "Player died" << endl; 214 this->isDead = true; 215 this->timeDied = getCurrentMillis(); 216 } 217 } 218 208 219 bool Player::updateTarget(map<unsigned int, Player*>& mapPlayers) { 209 220 if (this->isChasing) { -
common/Player.h
reb2ad4f r6054f1e 50 50 bool updateTarget(map<unsigned int, Player*>& mapPlayers); 51 51 bool move(WorldMap *map); 52 void takeDamage(int damage); 52 53 53 54 void takeFlag(int flag, WorldMap* map);
Note:
See TracChangeset
for help on using the changeset viewer.