- Timestamp:
- Apr 23, 2013, 1:43:13 AM (12 years ago)
- Branches:
- master
- Children:
- d211210
- Parents:
- a1a3bd5
- Location:
- common
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
common/Player.cpp
ra1a3bd5 r227baaa 83 83 } 84 84 85 bool Player::move(WorldMap map) {85 bool Player::move(WorldMap *map) { 86 86 int speed = 100; // pixels per second 87 87 unsigned long long curTime = getCurrentMillis(); … … 102 102 newPos.y = int(pos.y + sin(angle)*pixels); 103 103 104 switch(map .getElement(newPos.x/25, newPos.y/25)) {105 case WorldMap.TerrainType.TERRAIN_OCEAN:106 case WorldMap.TerrainType.TERRAIN_ROCK:107 108 109 110 104 switch(map->getElement(newPos.x/25, newPos.y/25)) { 105 case WorldMap::TERRAIN_NONE: 106 case WorldMap::TERRAIN_ROCK: 107 target.x = pos.x; 108 target.y = pos.y; 109 moveCanceled = true; 110 break; 111 111 } 112 112 } -
common/Player.h
ra1a3bd5 r227baaa 33 33 void setAddr(sockaddr_in addr); 34 34 35 bool move(WorldMap map);35 bool move(WorldMap *map); 36 36 37 37 int id;
Note:
See TracChangeset
for help on using the changeset viewer.