- Timestamp:
- May 18, 2013, 8:50:33 PM (11 years ago)
- Branches:
- master
- Children:
- e4a5786
- Parents:
- d69eb32
- Location:
- common
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
common/Player.cpp
rd69eb32 re76055f 113 113 } 114 114 115 //cout << "newPos.x: " << newPos.x << endl;116 //cout << "newPos.y: " << newPos.y << endl;117 //cout << "newPos.x/25: " << newPos.x/25 << endl;118 //cout << "newPos.y/25: " << newPos.y/25 << endl;119 120 115 switch(map->getElement(newPos.x/25, newPos.y/25)) { 121 116 case WorldMap::TERRAIN_NONE: 117 case WorldMap::TERRAIN_OCEAN: 122 118 case WorldMap::TERRAIN_ROCK: 123 119 cout << "Encountered invalid terrain" << endl; … … 132 128 break; 133 129 } 130 131 // using moveCanceled in a hacky way just to indicate that the server 132 // has updated some player info. Should change the variable name 133 switch(map->getObject(newPos.x/25, newPos.y/25)) { 134 case WorldMap::OBJECT_BLUE_FLAG: 135 hasBlueFlag = true; 136 moveCanceled = true; 137 break; 138 case WorldMap::OBJECT_RED_FLAG: 139 hasRedFlag = true; 140 moveCanceled = true; 141 break; 142 } 134 143 } 135 144 -
common/WorldMap.h
rd69eb32 re76055f 19 19 enum ObjectType { 20 20 OBJECT_NONE, 21 OBJECT_ RED_FLAG,22 OBJECT_ BLUE_FLAG21 OBJECT_BLUE_FLAG, 22 OBJECT_RED_FLAG 23 23 }; 24 24
Note:
See TracChangeset
for help on using the changeset viewer.