summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--src/components/map_collision.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/components/map_collision.cpp b/src/components/map_collision.cpp index 432fea6..3ad574b 100644 --- a/src/components/map_collision.cpp +++ b/src/components/map_collision.cpp
@@ -5,10 +5,10 @@
5 5
6MapCollisionComponent::MapCollisionComponent(const Map& map) : map(map) 6MapCollisionComponent::MapCollisionComponent(const Map& map) : map(map)
7{ 7{
8 addCollision(-6, 0, GAME_HEIGHT, Direction::left, collisionFromMoveType(map.getAdjacent(Map::MoveDir::Left).type)); 8 addCollision(-6, 0, MAP_HEIGHT*TILE_HEIGHT, Direction::left, collisionFromMoveType(map.getAdjacent(Map::MoveDir::Left).type));
9 addCollision(GAME_WIDTH+6, 0, GAME_HEIGHT, Direction::right, collisionFromMoveType(map.getAdjacent(Map::MoveDir::Right).type)); 9 addCollision(GAME_WIDTH+6, 0, MAP_HEIGHT*TILE_HEIGHT, Direction::right, collisionFromMoveType(map.getAdjacent(Map::MoveDir::Right).type));
10 addCollision(-7, 0, GAME_WIDTH, Direction::up, collisionFromMoveType(map.getAdjacent(Map::MoveDir::Up).type)); 10 addCollision(-6, 0, GAME_WIDTH, Direction::up, collisionFromMoveType(map.getAdjacent(Map::MoveDir::Up).type));
11 addCollision(GAME_HEIGHT+6, 0, GAME_WIDTH, Direction::down, collisionFromMoveType(map.getAdjacent(Map::MoveDir::Down).type)); 11 addCollision(MAP_HEIGHT*TILE_HEIGHT+6, 0, GAME_WIDTH, Direction::down, collisionFromMoveType(map.getAdjacent(Map::MoveDir::Down).type));
12 12
13 for (int i=0; i<MAP_WIDTH*MAP_HEIGHT; i++) 13 for (int i=0; i<MAP_WIDTH*MAP_HEIGHT; i++)
14 { 14 {
@@ -204,7 +204,7 @@ void MapCollisionComponent::processCollision(Game& game, Entity& collider, Colli
204 game.loadMap(game.getWorld().getMap(map.getAdjacent(Map::MoveDir::Right).map), std::make_pair(-collider.size.first/2, old_position.second)); 204 game.loadMap(game.getWorld().getMap(map.getAdjacent(Map::MoveDir::Right).map), std::make_pair(-collider.size.first/2, old_position.second));
205 } else if (dir == Direction::up) 205 } else if (dir == Direction::up)
206 { 206 {
207 game.loadMap(game.getWorld().getMap(map.getAdjacent(Map::MoveDir::Up).map), std::make_pair(old_position.first, GAME_HEIGHT-collider.size.second/2)); 207 game.loadMap(game.getWorld().getMap(map.getAdjacent(Map::MoveDir::Up).map), std::make_pair(old_position.first, MAP_HEIGHT*TILE_HEIGHT-collider.size.second/2));
208 } else if (dir == Direction::down) 208 } else if (dir == Direction::down)
209 { 209 {
210 game.loadMap(game.getWorld().getMap(map.getAdjacent(Map::MoveDir::Down).map), std::make_pair(old_position.first, -collider.size.second/2)); 210 game.loadMap(game.getWorld().getMap(map.getAdjacent(Map::MoveDir::Down).map), std::make_pair(old_position.first, -collider.size.second/2));