- Timestamp:
- May 18, 2013, 9:38:05 PM (12 years ago)
- Branches:
- master
- Children:
- 05051c7
- Parents:
- a78c387
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
common/Player.cpp
ra78c387 r035d852 100 100 FLOAT_POSITION newPos; 101 101 102 //cout << "pos.x: " << pos.x << endl;103 //cout << "pos.y: " << pos.y << endl;104 //cout << "target.x: " << target.x << endl;105 //cout << "target.y: " << target.y << endl;106 107 102 if (dist <= pixels) { 108 103 newPos.x = target.x; … … 117 112 case WorldMap::TERRAIN_OCEAN: 118 113 case WorldMap::TERRAIN_ROCK: 119 cout << "Encountered invalid terrain" << endl;120 114 target.x = pos.x; 121 115 target.y = pos.y; 122 116 moveCanceled = true; 123 cout << "move canceled" << endl;124 117 break; 125 118 default: // if there are no obstacles … … 131 124 // using moveCanceled in a hacky way just to indicate that the server 132 125 // has updated some player info. Should change the variable name 133 cout << "Object at location: " << map->getObject(newPos.x/25, newPos.y/25) << endl;134 126 switch(map->getObject(newPos.x/25, newPos.y/25)) { 135 127 case WorldMap::OBJECT_BLUE_FLAG: 136 128 hasBlueFlag = true; 137 cout << "Player got blue flag" << endl;138 129 moveCanceled = true; 139 130 break; 140 131 case WorldMap::OBJECT_RED_FLAG: 141 132 hasRedFlag = true; 142 cout << "Player got red flag" << endl;143 133 moveCanceled = true; 144 134 break; … … 148 138 timeLastUpdated = curTime; 149 139 150 if (moveCanceled)151 cout << "moveCancled == true" << endl;152 153 140 return !moveCanceled; 154 141 }
Note:
See TracChangeset
for help on using the changeset viewer.