Changeset 0129700 in network-game for common/Game.cpp
- Timestamp:
- Dec 19, 2013, 3:31:45 AM (11 years ago)
- Branches:
- master
- Children:
- fef7c69
- Parents:
- 70fc3e8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
common/Game.cpp
r70fc3e8 r0129700 67 67 } 68 68 69 bool Game::startPlayerMovement(unsigned int id, int x, int y) { 70 // need to check if players actually contains the id 71 Player* p = players[id]; 72 73 // we need to make sure the player can move here 74 if (0 <= x && x < this->worldMap->width*25 && 75 0 <= y && y < this->worldMap->height*25 && 76 this->worldMap->getElement(x/25, y/25) == WorldMap::TERRAIN_GRASS) 77 { 78 p->target.x = x; 79 p->target.y = y; 80 81 p->isChasing = false; 82 p->isAttacking = false; 83 84 return true; 85 } 86 else 87 return false; 88 } 89 69 90 void Game::setRedScore(int score) { 70 91 this->redScore = score;
Note:
See TracChangeset
for help on using the changeset viewer.