diff --git a/data/room/01.room b/data/room/01.room index bb528aa..b77a0cd 100644 --- a/data/room/01.room +++ b/data/room/01.room @@ -1,4 +1,4 @@ -name=Test Room +name=void main bg_color=black tileset=room1.png room_up=0 diff --git a/data/room/02.room b/data/room/02.room index f3af236..66c2a2b 100644 --- a/data/room/02.room +++ b/data/room/02.room @@ -1,10 +1,10 @@ -name=Test Room 2 +name=case switch bg_color=black tileset=room1.png room_up=0 room_down=04.room room_left=01.room -room_right=0 +room_right=03.room [tilemap] room2.tmx @@ -21,13 +21,13 @@ vy=1 x1=14 y1=0 x2=14 -y2=13 +y2=12 color=purple [enemy-end] [item] tileset=items.png -tile=0 +tile=1 x=19 y=6 [item-end] \ No newline at end of file diff --git a/data/room/03.room b/data/room/03.room index 0743b32..2715667 100644 --- a/data/room/03.room +++ b/data/room/03.room @@ -1,31 +1,63 @@ -name=Test Room 2 -bg_color=black +name=the edge +bg_color=light_black tileset=room1.png room_up=0 room_down=0 -room_left=01.room +room_left=02.room room_right=0 [tilemap] -room2.tmx +room3.tmx [tilemap-end] [enemy] -tileset=enemy01.png -x=14 -y=0 +tileset=enemy02.png +width=8 +height=16 +x=4 +y=5 vx=0 vy=1 -x1=14 -y1=0 -x2=14 +x1=4 +y1=2 +x2=4 +y2=13 +color=green +[enemy-end] + +[enemy] +tileset=enemy02.png +width=8 +height=16 +x=10 +y=4 +vx=0 +vy=1 +x1=10 +y1=2 +x2=10 +y2=13 +color=light_blue +[enemy-end] + +[enemy] +tileset=enemy02.png +width=8 +height=16 +x=16 +y=3 +vx=0 +vy=1 +x1=16 +y1=2 +x2=16 y2=13 color=purple [enemy-end] [item] tileset=items.png -tile=0 -x=19 -y=6 +tile=5 +x=12 +y=2 [item-end] \ No newline at end of file diff --git a/data/room/04.room b/data/room/04.room index 03ca55d..1f3098c 100644 --- a/data/room/04.room +++ b/data/room/04.room @@ -4,7 +4,7 @@ tileset=room1.png room_up=02.room room_down=0 room_left=0 -room_right=0 +room_right=05.room [tilemap] room4.tmx diff --git a/data/room/05.room b/data/room/05.room new file mode 100644 index 0000000..16a8c23 --- /dev/null +++ b/data/room/05.room @@ -0,0 +1,11 @@ +name=coruscant +bg_color=light_black +tileset=room1.png +room_up=03.room +room_down=0 +room_left=04.room +room_right=0 + +[tilemap] +room5.tmx +[tilemap-end] \ No newline at end of file diff --git a/data/room/room2.tmx b/data/room/room2.tmx index 0db6e4f..2d8f957 100644 --- a/data/room/room2.tmx +++ b/data/room/room2.tmx @@ -11,14 +11,14 @@ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23, 0,0,0,0,0,0,0,0,0,0,0,203,203,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,0,0,0,0,0,0,0,0,0,23, -23,23,23,23,23,23,0,0,0,203,0,0,0,0,0,0,0,0,0,263,0,0,0,0,203,203,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,263,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,203,0,0,0,0,0,0,0,0,0,263,0,0,0,0,203,203,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,263,0,0,0,0,0,0,0,0,0,203,203,23, -0,0,0,0,0,0,0,203,203,203,203,203,203,0,0,0,0,0,0,263,0,0,0,0,203,203,0,0,0,0,0,23, -0,0,0,0,0,203,0,0,0,0,0,0,0,0,0,0,0,0,0,263,0,0,0,0,0,0,0,0,0,0,0,23, -43,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,263,83,83,83,83,83,83,83,83,83,83,83,83, -43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,0,0,203,43,43,43,43,43,43,43,43,43,43,43,43,43,43 +23,23,23,23,23,23,0,0,0,203,0,0,0,0,0,0,0,0,0,23,0,0,0,0,203,203,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,203,0,0,0,0,0,0,0,0,0,23,0,0,0,0,203,203,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,0,0,0,0,0,0,0,0,0,203,203,23, +0,0,0,0,0,0,0,203,203,203,203,203,203,0,0,0,0,0,0,23,0,0,0,0,203,203,0,0,0,0,0,23, +0,0,0,0,0,203,0,0,0,0,0,0,0,0,0,0,0,0,0,23,0,0,0,0,0,0,0,0,0,0,0,23, +43,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,83,83,83,83,83,83,83,83,83,83,83,83, +43,43,43,43,43,43,43,43,43,43,43,43,43,43,223,0,0,223,43,43,43,43,43,43,43,43,43,43,43,43,43,43 diff --git a/data/room/room3.tmx b/data/room/room3.tmx index adb67c9..957bd75 100644 --- a/data/room/room3.tmx +++ b/data/room/room3.tmx @@ -6,10 +6,10 @@ 26,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 26,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 26,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -26,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -26,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -26,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -26,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +26,0,0,0,0,0,0,0,0,0,0,0,271,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +26,0,0,0,0,0,0,0,0,271,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +26,0,0,0,0,0,271,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +26,0,0,271,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 26,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,271,271,271,271,271,271,271,271,271,271,271,271,271,271,271,271,271,271,0,232,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, @@ -18,7 +18,7 @@ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -381,381,381,381,381,381,381,381,381,381,381,381,381,381,381,381,381,381,381,381,381,381,381,381,381,381,381,381,381,381,381,381 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/data/room/room4.tmx b/data/room/room4.tmx index 547b1a5..660ba8e 100644 --- a/data/room/room4.tmx +++ b/data/room/room4.tmx @@ -3,21 +3,21 @@ -25,249,249,249,249,249,249,249,249,249,249,249,249,249,249,0,0,0,249,249,249,249,249,249,249,249,249,249,249,249,249,25, +25,249,249,249,249,249,249,249,249,249,249,249,249,249,0,0,0,0,249,249,249,249,249,249,249,249,249,249,249,249,249,25, 25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25, -25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,230,0,0,0,0,0,0,0,0,0,0,0,0,0,25, -25,0,270,0,0,0,0,0,0,0,0,0,0,0,230,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25, -25,0,290,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25, -25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,0,0,230,0,0,0,0,0,0,0,0,0,0,0,0,0,25, -25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,270,270,270,270,270,270,0,0,270,270,25, -25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,290,0,0,290,0,0,0,0,0,25, -25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,290,0,0,290,0,0,0,0,0,25, -25,0,0,0,0,0,0,0,0,0,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25, 25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25, +25,0,0,0,0,0,0,0,0,0,0,0,0,0,230,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25, +25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25, +25,25,25,25,0,25,25,25,25,25,0,25,25,25,25,0,0,230,0,0,0,0,0,0,0,0,0,0,0,0,0,25, +25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,270,270,270,270,270,270,270,0,0,270,0,25, +25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,290,0,0,0,0,0,0,0,25, +25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,290,0,0,0,0,0,0,0,25, +25,0,0,0,0,0,0,0,0,0,0,25,25,25,25,0,0,25,25,25,25,25,25,25,0,0,0,0,0,0,0,25, +25,0,0,0,0,229,229,229,229,229,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25, 25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25, 25,249,249,249,249,249,249,249,249,249,249,249,249,249,249,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25, -22,0,0,0,0,0,289,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22, -22,0,0,0,0,0,289,0,0,0,0,0,0,0,0,0,0,0,381,0,0,0,0,0,0,381,0,0,0,0,0,22, +22,0,0,0,0,0,289,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +22,0,0,0,0,0,289,0,0,0,0,0,0,0,0,0,0,0,381,0,0,0,0,0,0,381,0,0,0,0,0,0, 25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25 diff --git a/data/room/room5.tmx b/data/room/room5.tmx new file mode 100644 index 0000000..cf30a7f --- /dev/null +++ b/data/room/room5.tmx @@ -0,0 +1,24 @@ + + + + + +25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,49,0,0,0,0,0,0,0,0,0,0, +25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +25,0,0,0,0,0,0,0,48,0,0,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,48,48,382,382,48,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,48,48,48,47,47,48,48,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48 + + + diff --git a/source/director.cpp b/source/director.cpp index 2bfe9d0..acbd016 100644 --- a/source/director.cpp +++ b/source/director.cpp @@ -201,10 +201,12 @@ void Director::setFileList() mAsset->add("/data/room/02.room", room); mAsset->add("/data/room/03.room", room); mAsset->add("/data/room/04.room", room); + mAsset->add("/data/room/05.room", room); mAsset->add("/data/room/room1.tmx", room); mAsset->add("/data/room/room2.tmx", room); mAsset->add("/data/room/room3.tmx", room); mAsset->add("/data/room/room4.tmx", room); + mAsset->add("/data/room/room5.tmx", room); mAsset->add("/media/tilesets/room1.png", bitmap); mAsset->add("/media/enemies/enemy01.png", bitmap); mAsset->add("/media/enemies/enemy02.png", bitmap); diff --git a/source/game.cpp b/source/game.cpp index 9740275..546f698 100644 --- a/source/game.cpp +++ b/source/game.cpp @@ -4,8 +4,8 @@ Game::Game(SDL_Window *window, SDL_Renderer *renderer, Asset *asset, Lang *lang, Input *input) { // Inicia variables - mCurrentRoom = "01.room"; - mSpawnPoint = {2 * 8, 12 * 8, 0, 0, 0, STATUS_STANDING, SDL_FLIP_NONE}; + mCurrentRoom = "02.room"; + mSpawnPoint = {2 * BLOCK, 12 * BLOCK, 0, 0, 0, STATUS_STANDING, SDL_FLIP_NONE}; mDebug = false; // Copia los punteros diff --git a/source/player.cpp b/source/player.cpp index e92382b..834ca92 100644 --- a/source/player.cpp +++ b/source/player.cpp @@ -102,7 +102,7 @@ void Player::checkInput() sprite->setVelX(0); } - if (input->checkInput(INPUT_UP, REPEAT_FALSE)) + if (input->checkInput(INPUT_UP, REPEAT_TRUE)) { setStatus(STATUS_JUMPING); } @@ -155,6 +155,7 @@ void Player::switchBorders() if (border == BORDER_TOP) { sprite->setPosY(PLAY_AREA_BOTTOM - sprite->getHeight() - 1); + jump_ini += 128; } else if (border == BORDER_BOTTOM) { @@ -280,7 +281,7 @@ void Player::checkJump() if (sprite->getVelY() > 0) if (sprite->getPosY() > jump_ini) { - status = STATUS_FALLING; + setStatus(STATUS_FALLING); } }