From 76696f9eb7e8623aa2d5638a4fb6c6410ea8e191 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Valor=20Mart=C3=ADnez?= Date: Fri, 19 Aug 2022 07:21:25 +0200 Subject: [PATCH] Retocado un poco mas el salto --- data/animations/player.ani | 2 +- data/map/01 - copia.tmx | 38 -------------------------------------- data/map/01_8.tmx | 28 ++++++++++++++-------------- data/map/tiles_surface.tsx | 4 ++++ source/player.cpp | 4 +++- 5 files changed, 22 insertions(+), 54 deletions(-) delete mode 100644 data/map/01 - copia.tmx create mode 100644 data/map/tiles_surface.tsx diff --git a/data/animations/player.ani b/data/animations/player.ani index 5b628b0..d04d55e 100644 --- a/data/animations/player.ani +++ b/data/animations/player.ani @@ -11,7 +11,7 @@ frames=0,1,2,2,1,0,0,1,2,2,1,0,0,1,2,2,1,0,0,1,2,2,1,0,0,1,2,3,4,5,6,7,0,0,0,0 [animation] name=walk -speed=6 +speed=4 loop=yes frames=8,9,10,10,9,8,11,12,13,13,14,15 [/animation] diff --git a/data/map/01 - copia.tmx b/data/map/01 - copia.tmx deleted file mode 100644 index c8bd17e..0000000 --- a/data/map/01 - copia.tmx +++ /dev/null @@ -1,38 +0,0 @@ - - - - - -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,225,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - - - - -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,68,68,0,0,0,0,0,0,0,0,74,74,74,0,0,0,0, -74,74,74,75,75,74,74,68,68,68,68,68,74,74,78,74,68,74,68,68 - - - diff --git a/data/map/01_8.tmx b/data/map/01_8.tmx index af00e86..c87ee56 100644 --- a/data/map/01_8.tmx +++ b/data/map/01_8.tmx @@ -1,6 +1,6 @@ - + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, @@ -12,22 +12,22 @@ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,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,239,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,257,258,257,258,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,93,94,0,0,0,0,0,0,263,0,0,0,0,0,0, -0,0,0,289,290,289,290,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,125,126,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,157,158,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,0,0,0,0,0,0,0,0,0,0,0,0,189,190,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,193,194,0,0,0,0,0,0,0,0,0,0,0,0,0,281,282,277,278,279,280,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,225,226,0,0,0,0,0,0,0,0,281,275,275,275,275,313,314,309,310,311,312,0,0,0,0,0,0,0,0,0,0,0,0, -263,264,263,264,263,264,263,264,263,264,263,264,263,264,263,264,263,264,263,266,266,266,283,284,266,265,266,264,263,264,263,264,263,264,263,264,263,264,263,264, +0,0,0,0,239,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,265,266,0,0,0,0,0,0,0,0,0,0, +0,0,0,257,258,257,258,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,93,94,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,289,290,289,290,0,0,0,0,577,578,579,580,581,582,0,0,0,0,0,0,0,0,125,126,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,609,610,611,612,613,614,0,0,0,0,0,0,0,0,157,158,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,189,190,0,0,0,0,0,0,0,0,0,0,189,190,0,0,0,0,0,0,0,0,0,0,0,0,0, +263,264,0,0,0,0,0,193,194,0,0,159,160,189,190,0,0,0,0,0,0,0,281,282,277,278,279,280,0,0,0,0,0,0,0,0,0,0,0,0, +295,296,0,0,0,0,0,225,226,0,0,191,192,189,190,0,0,281,275,275,275,275,313,314,309,310,311,312,0,0,0,0,0,0,0,0,0,0,0,0, +265,264,263,264,263,264,263,264,263,264,263,264,263,264,263,264,263,264,263,266,266,266,283,284,266,265,266,264,263,264,263,264,263,264,263,264,263,264,263,264, 295,296,295,296,295,296,295,296,295,296,295,296,295,296,295,296,295,296,295,296,295,296,315,316,298,297,298,296,295,296,295,296,295,296,295,296,295,296,295,296 diff --git a/data/map/tiles_surface.tsx b/data/map/tiles_surface.tsx new file mode 100644 index 0000000..41c3a9f --- /dev/null +++ b/data/map/tiles_surface.tsx @@ -0,0 +1,4 @@ + + + + diff --git a/source/player.cpp b/source/player.cpp index 89d0f11..b5fe7db 100644 --- a/source/player.cpp +++ b/source/player.cpp @@ -117,6 +117,7 @@ void Player::checkInput() jumpStrenght = std::max(jumpStrenght -= 0.4f, 0.0f); vy -= jumpStrenght; } + jumpPressed = true; } else { @@ -218,7 +219,6 @@ void Player::move() } while (checkMapCollisions()); jumping = false; vy = 0.0f; - jumpStrenght = 2.0f; } else { @@ -226,6 +226,8 @@ void Player::move() { y++; } while (checkMapCollisions()); + jumping = false; + vy = 0.0f; } }