Arco de salto mejorado

This commit is contained in:
2022-07-10 21:36:48 +02:00
parent 8d49c78519
commit 6059a3b894
5 changed files with 13 additions and 5 deletions

View File

@@ -213,6 +213,10 @@ void Game::checkPlayerOnFloor()
{
// Comprueba si tiene suelo bajo los pies solo cuando no hay velocidad de subida
// y solo cuando el pie este encima de un bloque, es decir, en multiplos de 8
// *** HAY UN POSIBLE PROBLEMA y es que caiga muy rapido y viaje a mas de un pixel de velocidad,
// con lo que se saltaria la comprobación
if ((mPlayer->getVelY() >= 0) && ((int)mPlayer->getLeftFoot().y % 8 == 0))
{ // Comprueba ambos pies
bool test = false;

View File

@@ -16,8 +16,8 @@
#define STATUS_JUMPING 1
#define STATUS_FALLING 2
#define GRAVITY 0.02f
#define MAX_VY 0.9f
#define GRAVITY 0.035f
#define MAX_VY 1.2f
// Clase Player
class Player

View File

@@ -316,12 +316,14 @@ int Room::getTile(SDL_Point point)
if (pos < 512)
{
if (tilemap[pos] == 41)
// Los tiles entre el 1 y el 80 son solidos
if ((tilemap[pos] > 0) && (tilemap[pos] < 81))
{
return TILE_SOLID;
}
if (tilemap[pos] == 81)
// Los tiles mayores de 80 son atravesables
if (tilemap[pos] > 80)
{
return TILE_TRAVESSABLE;
}