Changeset ff2133a in network-game for common/Player.cpp
- Timestamp:
- Jun 11, 2013, 1:24:09 AM (12 years ago)
- Branches:
- master
- Children:
- 5b1e31e
- Parents:
- 11d21ee
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
common/Player.cpp
r11d21ee rff2133a 191 191 return moving; 192 192 } 193 194 void Player::updateTarget(map<unsigned int, Player>& mapPlayers) { 195 if (this->isChasing) { 196 this->target.x = mapPlayers[this->targetPlayer].pos.x; 197 this->target.y = mapPlayers[this->targetPlayer].pos.y; 198 199 if (posDistance(this->pos, this->target.toFloat()) <= this->range) { 200 this->target.x = this->pos.x; 201 this->target.y = this->pos.y; 202 203 this->isChasing = false; 204 this->isAttacking = true; 205 this->timeAttackStarted = getCurrentMillis(); 206 } 207 } 208 }
Note:
See TracChangeset
for help on using the changeset viewer.