summary refs log tree commit diff stats
path: root/src/components
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2015-03-14 21:02:01 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2015-03-14 21:02:01 -0400
commitb563953a4846bab720cae17ef4ab5a8296730c7c (patch)
treee585bda1e4a8b979c8864cd25a84f663122c83b7 /src/components
parent6b1dcc5df51df4a2d8b724187eb1bcdb4fd9df8b (diff)
downloadtherapy-b563953a4846bab720cae17ef4ab5a8296730c7c.tar.gz
therapy-b563953a4846bab720cae17ef4ab5a8296730c7c.tar.bz2
therapy-b563953a4846bab720cae17ef4ab5a8296730c7c.zip
Started writing map editor
Diffstat (limited to 'src/components')
-rw-r--r--src/components/map_collision.cpp2
-rw-r--r--src/components/map_render.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/components/map_collision.cpp b/src/components/map_collision.cpp index f385320..9afa6f8 100644 --- a/src/components/map_collision.cpp +++ b/src/components/map_collision.cpp
@@ -7,7 +7,7 @@ MapCollisionComponent::MapCollisionComponent(const Map& map) : map(map)
7 addCollision(-6, 0, GAME_WIDTH, Direction::left, (map.getLeftMap() == nullptr) ? Collision::Type::wrap : Collision::Type::teleport); 7 addCollision(-6, 0, GAME_WIDTH, Direction::left, (map.getLeftMap() == nullptr) ? Collision::Type::wrap : Collision::Type::teleport);
8 addCollision(GAME_WIDTH+6, 0, GAME_WIDTH, Direction::right, (map.getRightMap() == nullptr) ? Collision::Type::reverse : Collision::Type::teleport); 8 addCollision(GAME_WIDTH+6, 0, GAME_WIDTH, Direction::right, (map.getRightMap() == nullptr) ? Collision::Type::reverse : Collision::Type::teleport);
9 9
10 for (int i=0; i<MAP_WIDTH*(MAP_HEIGHT-1); i++) 10 for (int i=0; i<MAP_WIDTH*MAP_HEIGHT; i++)
11 { 11 {
12 int x = i % MAP_WIDTH; 12 int x = i % MAP_WIDTH;
13 int y = i / MAP_WIDTH; 13 int y = i / MAP_WIDTH;
diff --git a/src/components/map_render.cpp b/src/components/map_render.cpp index d93afe6..6fdfcc3 100644 --- a/src/components/map_render.cpp +++ b/src/components/map_render.cpp
@@ -8,7 +8,7 @@ MapRenderComponent::MapRenderComponent(const Map& map) : screen(GAME_WIDTH, GAME
8 8
9 Texture tiles("../res/tiles.png"); 9 Texture tiles("../res/tiles.png");
10 10
11 for (int i=0; i<MAP_WIDTH*(MAP_HEIGHT-1); i++) 11 for (int i=0; i<MAP_WIDTH*MAP_HEIGHT; i++)
12 { 12 {
13 int tile = map.getMapdata()[i]; 13 int tile = map.getMapdata()[i];
14 int x = i % MAP_WIDTH; 14 int x = i % MAP_WIDTH;