forked from jaildesigner-jailgames/jaildoctors_dilemma
FIx: El jugador no se moria al caer de alto si se mantenia la tecla de slto pulsada
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
#include "notify.h"
|
#include "notify.h"
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
Notify::Notify(SDL_Renderer *renderer, std::string bitmapFile, std::string textFile)
|
Notify::Notify(SDL_Renderer *renderer, std::string bitmapFile, std::string textFile)
|
||||||
@@ -36,6 +37,8 @@ void Notify::render()
|
|||||||
{
|
{
|
||||||
notifications.at(i).sprite->render();
|
notifications.at(i).sprite->render();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
text->write(8,8,"TEXTO DE PRUEBA");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Actualiza el estado de las notificaiones
|
// Actualiza el estado de las notificaiones
|
||||||
@@ -114,7 +117,6 @@ void Notify::showText(std::string text)
|
|||||||
const int despH = this->text->getCharacterSize() / 2;
|
const int despH = this->text->getCharacterSize() / 2;
|
||||||
const int despV = despH;
|
const int despV = despH;
|
||||||
const int travelDist = height + despV;
|
const int travelDist = height + despV;
|
||||||
// const int offset = (int)notifications.size() * (travelDist) + despV;
|
|
||||||
const int offset = (int)notifications.size() > 0 ? notifications.back().y + travelDist : despV;
|
const int offset = (int)notifications.size() > 0 ? notifications.back().y + travelDist : despV;
|
||||||
|
|
||||||
// Crea la notificacion
|
// Crea la notificacion
|
||||||
@@ -142,6 +144,12 @@ void Notify::showText(std::string text)
|
|||||||
|
|
||||||
// Añade la notificación a la lista
|
// Añade la notificación a la lista
|
||||||
notifications.push_back(n);
|
notifications.push_back(n);
|
||||||
|
|
||||||
|
//std::cout << "Notification " << notifications.size() << std::endl;
|
||||||
|
//std::cout << "width " << width << std::endl;
|
||||||
|
//std::cout << "height " << height << std::endl;
|
||||||
|
//std::cout << "offset " << offset << std::endl;
|
||||||
|
//std::cout << "desp " << despH << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Indica si hay notificaciones activas
|
// Indica si hay notificaciones activas
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ void Screen::blit()
|
|||||||
SDL_RenderCopy(renderer, gameCanvas, nullptr, &dest);
|
SDL_RenderCopy(renderer, gameCanvas, nullptr, &dest);
|
||||||
|
|
||||||
// Dibuja las notificaciones
|
// Dibuja las notificaciones
|
||||||
//renderNotifications();
|
renderNotifications();
|
||||||
|
|
||||||
// Muestra por pantalla el renderizador
|
// Muestra por pantalla el renderizador
|
||||||
SDL_RenderPresent(renderer);
|
SDL_RenderPresent(renderer);
|
||||||
@@ -361,7 +361,7 @@ void Screen::renderNotifications()
|
|||||||
// return;
|
// return;
|
||||||
//}
|
//}
|
||||||
|
|
||||||
SDL_RenderSetLogicalSize(renderer, windowWidth, windowHeight);
|
//SDL_RenderSetLogicalSize(renderer, windowWidth * options->windowSize, windowHeight * options->windowSize);
|
||||||
notify->render();
|
notify->render();
|
||||||
SDL_RenderSetLogicalSize(renderer, gameCanvasWidth, gameCanvasHeight);
|
//SDL_RenderSetLogicalSize(renderer, windowWidth, windowHeight);
|
||||||
}
|
}
|
||||||
@@ -21,9 +21,9 @@ Game::Game(SDL_Renderer *renderer, Screen *screen, Resource *resource, Asset *as
|
|||||||
this->options = options;
|
this->options = options;
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
currentRoom = "48.room";
|
currentRoom = "02.room";
|
||||||
const int x1 = 18;
|
const int x1 = 20;
|
||||||
const int y1 = 13;
|
const int y1 = 6;
|
||||||
spawnPoint = {x1 * 8, y1 * 8, 0, 0, 0, s_standing, SDL_FLIP_HORIZONTAL};
|
spawnPoint = {x1 * 8, y1 * 8, 0, 0, 0, s_standing, SDL_FLIP_HORIZONTAL};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -823,6 +823,8 @@ void Player::setState(state_e value)
|
|||||||
{
|
{
|
||||||
prevState = state;
|
prevState = state;
|
||||||
state = value;
|
state = value;
|
||||||
|
|
||||||
|
checkState();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Comprueba si el jugador esta vivo
|
// Comprueba si el jugador esta vivo
|
||||||
|
|||||||
@@ -14,7 +14,9 @@ Stats::Stats(std::string file)
|
|||||||
// Destructor
|
// Destructor
|
||||||
Stats::~Stats()
|
Stats::~Stats()
|
||||||
{
|
{
|
||||||
|
#ifndef DEBUG
|
||||||
saveToFile();
|
saveToFile();
|
||||||
|
#endif
|
||||||
list.clear();
|
list.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -115,6 +115,12 @@ void Title::checkEventHandler()
|
|||||||
switchPalette();
|
switchPalette();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
case SDL_SCANCODE_F6:
|
||||||
|
screen->showText("MAMA MIRA! SIN MANOS!");
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user