Creando habitaciones
This commit is contained in:
@@ -381,11 +381,13 @@ void Director::loadResources(section_t section)
|
||||
textureList.push_back("sam.png");
|
||||
textureList.push_back("sigmasua.png");
|
||||
textureList.push_back("spider.png");
|
||||
textureList.push_back("spark.png");
|
||||
textureList.push_back("tuno.png");
|
||||
textureList.push_back("tv_panel.png");
|
||||
textureList.push_back("tv.png");
|
||||
textureList.push_back("shock.png");
|
||||
textureList.push_back("wave.png");
|
||||
textureList.push_back("z80.png");
|
||||
|
||||
// Player
|
||||
textureList.push_back("player.png");
|
||||
@@ -437,11 +439,13 @@ void Director::loadResources(section_t section)
|
||||
animationList.push_back("sam.ani");
|
||||
animationList.push_back("sigmasua.ani");
|
||||
animationList.push_back("spider.ani");
|
||||
animationList.push_back("spark.ani");
|
||||
animationList.push_back("tuno.ani");
|
||||
animationList.push_back("tv_panel.ani");
|
||||
animationList.push_back("tv.ani");
|
||||
animationList.push_back("shock.ani");
|
||||
animationList.push_back("wave.ani");
|
||||
animationList.push_back("z80.ani");
|
||||
|
||||
// Player
|
||||
animationList.push_back("player.ani");
|
||||
@@ -532,12 +536,14 @@ void Director::loadResources(section_t section)
|
||||
textureList.push_back("qvoid.png");
|
||||
textureList.push_back("sam.png");
|
||||
textureList.push_back("sigmasua.png");
|
||||
textureList.push_back("spark.png");
|
||||
textureList.push_back("spider.png");
|
||||
textureList.push_back("tuno.png");
|
||||
textureList.push_back("tv_panel.png");
|
||||
textureList.push_back("tv.png");
|
||||
textureList.push_back("shock.png");
|
||||
textureList.push_back("wave.png");
|
||||
textureList.push_back("z80.png");
|
||||
|
||||
// Items
|
||||
textureList.push_back("items.png");
|
||||
@@ -595,12 +601,14 @@ void Director::loadResources(section_t section)
|
||||
animationList.push_back("qvoid.ani");
|
||||
animationList.push_back("sam.ani");
|
||||
animationList.push_back("sigmasua.ani");
|
||||
animationList.push_back("spark.ani");
|
||||
animationList.push_back("spider.ani");
|
||||
animationList.push_back("tuno.ani");
|
||||
animationList.push_back("tv_panel.ani");
|
||||
animationList.push_back("tv.ani");
|
||||
animationList.push_back("shock.ani");
|
||||
animationList.push_back("wave.ani");
|
||||
animationList.push_back("z80.ani");
|
||||
|
||||
resource->loadAnimations(animationList);
|
||||
|
||||
@@ -1193,6 +1201,8 @@ bool Director::setFileList()
|
||||
asset->add(prefix + "/data/enemies/sam.png", t_bitmap);
|
||||
asset->add(prefix + "/data/enemies/sigmasua.ani", t_data);
|
||||
asset->add(prefix + "/data/enemies/sigmasua.png", t_bitmap);
|
||||
asset->add(prefix + "/data/enemies/spark.ani", t_data);
|
||||
asset->add(prefix + "/data/enemies/spark.png", t_bitmap);
|
||||
asset->add(prefix + "/data/enemies/spider.ani", t_data);
|
||||
asset->add(prefix + "/data/enemies/spider.png", t_bitmap);
|
||||
asset->add(prefix + "/data/enemies/tuno.ani", t_data);
|
||||
@@ -1205,6 +1215,8 @@ bool Director::setFileList()
|
||||
asset->add(prefix + "/data/enemies/shock.png", t_bitmap);
|
||||
asset->add(prefix + "/data/enemies/wave.ani", t_data);
|
||||
asset->add(prefix + "/data/enemies/wave.png", t_bitmap);
|
||||
asset->add(prefix + "/data/enemies/z80.ani", t_data);
|
||||
asset->add(prefix + "/data/enemies/z80.png", t_bitmap);
|
||||
|
||||
// Jugador
|
||||
asset->add(prefix + "/data/player/player.png", t_bitmap);
|
||||
|
||||
@@ -288,9 +288,11 @@ void Ending2::iniSpriteList()
|
||||
spriteList.push_back("diskette");
|
||||
spriteList.push_back("bird");
|
||||
spriteList.push_back("chip");
|
||||
spriteList.push_back("spark");
|
||||
spriteList.push_back("code");
|
||||
spriteList.push_back("paco");
|
||||
spriteList.push_back("printer");
|
||||
spriteList.push_back("z80");
|
||||
|
||||
spriteList.push_back("bell");
|
||||
spriteList.push_back("dong");
|
||||
|
||||
@@ -21,6 +21,7 @@ Enemy::Enemy(enemy_t enemy)
|
||||
sprite->setWidth(enemy.w);
|
||||
sprite->setHeight(enemy.h);
|
||||
doFlip = enemy.flip;
|
||||
mirror = enemy.mirror;
|
||||
if (doFlip)
|
||||
{
|
||||
if (enemy.vx < 0.0f)
|
||||
|
||||
@@ -26,6 +26,7 @@ struct enemy_t
|
||||
int y1; // Limite superior de la ruta en el eje Y
|
||||
int y2; // Limite inferior de la ruta en el eje Y
|
||||
bool flip; // Indica si el enemigo hace flip al terminar su ruta
|
||||
bool mirror; // Indica si el enemigo está volteado verticalmente
|
||||
std::string color; // Color del enemigo
|
||||
palette_e palette; // Paleta de colores
|
||||
};
|
||||
@@ -46,6 +47,7 @@ private:
|
||||
int y2; // Limite inferior de la ruta en el eje Y
|
||||
SDL_Rect collider; // Caja de colisión
|
||||
bool doFlip; // Indica si el enemigo hace flip al terminar su ruta
|
||||
bool mirror; // Indica si el enemigo se dibuja volteado verticalmente
|
||||
|
||||
// Comprueba si ha llegado al limite del recorrido para darse media vuelta
|
||||
void checkPath();
|
||||
|
||||
@@ -78,6 +78,7 @@ room_t loadRoomFile(std::string file_path, bool verbose)
|
||||
{
|
||||
enemy_t enemy;
|
||||
enemy.flip = false;
|
||||
enemy.mirror = false;
|
||||
enemy.palette = p_zxspectrum;
|
||||
|
||||
do
|
||||
@@ -316,6 +317,11 @@ bool setEnemy(enemy_t *enemy, std::string var, std::string value)
|
||||
enemy->flip = stringToBool(value);
|
||||
}
|
||||
|
||||
else if (var == "mirror")
|
||||
{
|
||||
enemy->mirror = stringToBool(value);
|
||||
}
|
||||
|
||||
else if (var == "color")
|
||||
{
|
||||
enemy->color = value;
|
||||
@@ -734,7 +740,7 @@ tile_e Room::getTile(SDL_Point point)
|
||||
// Devuelve el tipo de tile que hay en ese indice
|
||||
tile_e Room::getTile(int index)
|
||||
{
|
||||
//const bool onRange = (index > -1) && (index < mapWidth * mapHeight);
|
||||
// const bool onRange = (index > -1) && (index < mapWidth * mapHeight);
|
||||
const bool onRange = (index > -1) && (index < (int)tileMap.size());
|
||||
|
||||
if (onRange)
|
||||
@@ -975,7 +981,7 @@ void Room::setTopSurfaces()
|
||||
}
|
||||
}
|
||||
|
||||
// Añade un terminador
|
||||
// Añade un terminador
|
||||
tile.push_back(-1);
|
||||
|
||||
// Recorre el vector de tiles buscando tiles consecutivos para localizar las superficies
|
||||
@@ -1036,7 +1042,7 @@ void Room::setLeftSurfaces()
|
||||
}
|
||||
}
|
||||
|
||||
// Añade un terminador
|
||||
// Añade un terminador
|
||||
tile.push_back(-1);
|
||||
|
||||
// Recorre el vector de tiles buscando tiles consecutivos
|
||||
@@ -1084,7 +1090,7 @@ void Room::setRightSurfaces()
|
||||
}
|
||||
}
|
||||
|
||||
// Añade un terminador
|
||||
// Añade un terminador
|
||||
tile.push_back(-1);
|
||||
|
||||
// Recorre el vector de tiles buscando tiles consecutivos
|
||||
|
||||
Reference in New Issue
Block a user