Trabajando en las nuevas pantallas
This commit is contained in:
@@ -27,7 +27,7 @@ Game::Game(SDL_Renderer *renderer, Screen *screen, Asset *asset, Input *input)
|
||||
section.subsection = SUBSECTION_GAME_PLAY;
|
||||
|
||||
musicEnabled = true;
|
||||
debug = false;
|
||||
debug = true;
|
||||
musicEnabled = !debug;
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ void Game::checkInput()
|
||||
if (input->checkInput(INPUT_BUTTON_2, REPEAT_FALSE))
|
||||
{
|
||||
debug = !debug;
|
||||
musicEnabled = !debug;
|
||||
/*musicEnabled = !debug;
|
||||
if (musicEnabled)
|
||||
{
|
||||
JA_PlayMusic(music);
|
||||
@@ -125,7 +125,7 @@ void Game::checkInput()
|
||||
else
|
||||
{
|
||||
JA_StopMusic();
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
if (input->checkInput(INPUT_BUTTON_3, REPEAT_FALSE))
|
||||
@@ -195,7 +195,7 @@ void Game::renderDebugInfo()
|
||||
text = "state " + std::to_string(player->state);
|
||||
debugText->write(0, line += 6, text, -1);
|
||||
|
||||
text = map->getRoomFileName(b_top) + " " + map->getRoomFileName(b_right) + " " + map->getRoomFileName(b_bottom) + " " + map->getRoomFileName(b_left);
|
||||
text = map->getName() + " (" + map->getRoomFileName(b_top) + ", " + map->getRoomFileName(b_right) + ", " + map->getRoomFileName(b_bottom) + ", " + map->getRoomFileName(b_left) + ")";
|
||||
debugText->write(0, line += 6, text, -1);
|
||||
|
||||
text = "hookedOn = " + std::to_string(player->hookedOnMovingPlatform);
|
||||
|
||||
@@ -7,7 +7,7 @@ Map::Map(std::string file, SDL_Renderer *renderer, Asset *asset, ItemTracker *it
|
||||
tile_size = 8;
|
||||
map_width = 40;
|
||||
map_height = 26;
|
||||
tileset_width = 32;
|
||||
tileset_width = 34;
|
||||
name = file.substr(file.find_last_of("\\/") + 1);
|
||||
enemy_file = "";
|
||||
bgColor1 = bgColor2 = {0, 0, 0};
|
||||
@@ -422,15 +422,14 @@ e_tile_map Map::getTile(SDL_Point p)
|
||||
|
||||
// Calcula el tile
|
||||
const int tile = tilemap[((y / tile_size) * map_width) + (x / tile_size)];
|
||||
const int png_width = 32;
|
||||
|
||||
// Las 8 primeras filas son tiles de fondo
|
||||
if (tile >= 0 && tile < 8 * png_width)
|
||||
if (tile >= 0 && tile < 8 * tileset_width)
|
||||
{
|
||||
return nothing;
|
||||
}
|
||||
// De la fila 8 a la 15 hay tiles de muro
|
||||
else if (tile >= (8 * png_width) && tile < 16 * png_width)
|
||||
else if (tile >= (8 * tileset_width) && tile < 16 * tileset_width)
|
||||
{
|
||||
return wall;
|
||||
}
|
||||
@@ -511,6 +510,12 @@ std::string Map::getRoomFileName(e_border border)
|
||||
return "";
|
||||
}
|
||||
|
||||
// Devuelve el nombre del fichero de la habitación
|
||||
std::string Map::getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
// Indica si hay colision con un actor a partir de un rectangulo
|
||||
int Map::actorCollision(SDL_Rect &rect)
|
||||
{
|
||||
|
||||
@@ -97,6 +97,9 @@ public:
|
||||
// Devuelve el nombre del fichero de la habitación en funcion del borde
|
||||
std::string getRoomFileName(e_border border);
|
||||
|
||||
// Devuelve el nombre del fichero de la habitación
|
||||
std::string getName();
|
||||
|
||||
// Indica si hay colision con un actor a partir de un rectangulo
|
||||
int actorCollision(SDL_Rect &rect);
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ Prog::Prog(std::string executablePath)
|
||||
}
|
||||
else
|
||||
{
|
||||
section.name = SECTION_PROG_LOGO;
|
||||
section.name = SECTION_PROG_GAME;
|
||||
}
|
||||
input = new Input(asset->get("gamecontrollerdb.txt"));
|
||||
screen = new Screen(window, renderer, options);
|
||||
@@ -147,6 +147,20 @@ bool Prog::setFileList()
|
||||
asset->add("/data/map/03.map", data);
|
||||
asset->add("/data/map/03.tmx", data);
|
||||
asset->add("/data/map/03.ene", data);
|
||||
asset->add("/data/map/04.map", data);
|
||||
asset->add("/data/map/04.tmx", data);
|
||||
asset->add("/data/map/05.map", data);
|
||||
asset->add("/data/map/05.tmx", data);
|
||||
asset->add("/data/map/06.map", data);
|
||||
asset->add("/data/map/06.tmx", data);
|
||||
asset->add("/data/map/07.map", data);
|
||||
asset->add("/data/map/07.tmx", data);
|
||||
asset->add("/data/map/08.map", data);
|
||||
asset->add("/data/map/08.tmx", data);
|
||||
asset->add("/data/map/09.map", data);
|
||||
asset->add("/data/map/09.tmx", data);
|
||||
asset->add("/data/map/10.map", data);
|
||||
asset->add("/data/map/10.tmx", data);
|
||||
asset->add("/data/map/surface.png", bitmap);
|
||||
|
||||
// Ficheros de configuración
|
||||
|
||||
Reference in New Issue
Block a user