forked from jaildesigner-jailgames/jaildoctors_dilemma
Primera build. Ja mostra algo per pantalla. Primer esqueleto del joc. Encara no te res mes
This commit is contained in:
@@ -36,7 +36,7 @@ Director::Director(std::string path)
|
||||
}
|
||||
|
||||
// Crea los objetos
|
||||
mInput = new Input(mFileList[53]);
|
||||
mInput = new Input(mFileList[11]);
|
||||
|
||||
// Inicializa SDL
|
||||
initSDL();
|
||||
@@ -123,8 +123,8 @@ bool Director::initSDL()
|
||||
bool success = true;
|
||||
|
||||
// Inicializa SDL
|
||||
//if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_GAMECONTROLLER | SDL_INIT_AUDIO) < 0)
|
||||
if (SDL_Init(SDL_INIT_EVERYTHING) < 0)
|
||||
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_GAMECONTROLLER | SDL_INIT_AUDIO) < 0)
|
||||
//if (SDL_Init(SDL_INIT_EVERYTHING) < 0)
|
||||
{
|
||||
printf("SDL could not initialize!\nSDL Error: %s\n", SDL_GetError());
|
||||
success = false;
|
||||
@@ -185,75 +185,24 @@ void Director::setFileList()
|
||||
for (int i = 0; i < MAX_FILE_LIST; i++)
|
||||
mFileList[i] = "";
|
||||
|
||||
// Ficheros binarios
|
||||
mFileList[0] = mExecutablePath + "/" + "../data/score.bin";
|
||||
mFileList[1] = mExecutablePath + "/" + "../data/demo.bin";
|
||||
mFileList[2] = mExecutablePath + "/" + "../data/config.bin";
|
||||
|
||||
// Musicas
|
||||
mFileList[3] = mExecutablePath + "/" + "../media/music/intro.ogg";
|
||||
mFileList[4] = mExecutablePath + "/" + "../media/music/playing.ogg";
|
||||
mFileList[5] = mExecutablePath + "/" + "../media/music/title.ogg";
|
||||
|
||||
// Sonidos
|
||||
mFileList[6] = mExecutablePath + "/" + "../media/sound/balloon.wav";
|
||||
mFileList[7] = mExecutablePath + "/" + "../media/sound/bubble1.wav";
|
||||
mFileList[8] = mExecutablePath + "/" + "../media/sound/bubble2.wav";
|
||||
mFileList[9] = mExecutablePath + "/" + "../media/sound/bubble3.wav";
|
||||
mFileList[10] = mExecutablePath + "/" + "../media/sound/bubble4.wav";
|
||||
mFileList[11] = mExecutablePath + "/" + "../media/sound/bullet.wav";
|
||||
mFileList[12] = mExecutablePath + "/" + "../media/sound/coffeeout.wav";
|
||||
mFileList[13] = mExecutablePath + "/" + "../media/sound/hiscore.wav";
|
||||
mFileList[14] = mExecutablePath + "/" + "../media/sound/itemdrop.wav";
|
||||
mFileList[15] = mExecutablePath + "/" + "../media/sound/itempickup.wav";
|
||||
mFileList[16] = mExecutablePath + "/" + "../media/sound/menu_cancel.wav";
|
||||
mFileList[17] = mExecutablePath + "/" + "../media/sound/menu_move.wav";
|
||||
mFileList[18] = mExecutablePath + "/" + "../media/sound/menu_select.wav";
|
||||
mFileList[19] = mExecutablePath + "/" + "../media/sound/player_collision.wav";
|
||||
mFileList[20] = mExecutablePath + "/" + "../media/sound/stage_change.wav";
|
||||
mFileList[21] = mExecutablePath + "/" + "../media/sound/title.wav";
|
||||
mFileList[22] = mExecutablePath + "/" + "../media/sound/clock.wav";
|
||||
mFileList[23] = mExecutablePath + "/" + "../media/sound/powerball.wav";
|
||||
|
||||
// Texturas
|
||||
mFileList[24] = mExecutablePath + "/" + "../media/gfx/balloon.png";
|
||||
mFileList[25] = mExecutablePath + "/" + "../media/gfx/bullet.png";
|
||||
mFileList[31] = mExecutablePath + "/" + "../media/gfx/game_bg.png";
|
||||
mFileList[32] = mExecutablePath + "/" + "../media/gfx/game_text.png";
|
||||
mFileList[33] = mExecutablePath + "/" + "../media/gfx/intro.png";
|
||||
mFileList[34] = mExecutablePath + "/" + "../media/gfx/items.png";
|
||||
mFileList[35] = mExecutablePath + "/" + "../media/gfx/logo.png";
|
||||
mFileList[37] = mExecutablePath + "/" + "../media/gfx/player1_body.png";
|
||||
mFileList[38] = mExecutablePath + "/" + "../media/gfx/player1_death.png";
|
||||
mFileList[39] = mExecutablePath + "/" + "../media/gfx/player1_legs.png";
|
||||
mFileList[40] = mExecutablePath + "/" + "../media/gfx/title.png";
|
||||
mFileList[41] = mExecutablePath + "/" + "../media/gfx/player1_head.png";
|
||||
mFileList[42] = mExecutablePath + "/" + "../media/gfx/player2_body.png";
|
||||
mFileList[43] = mExecutablePath + "/" + "../media/gfx/player2_death.png";
|
||||
mFileList[44] = mExecutablePath + "/" + "../media/gfx/player2_legs.png";
|
||||
mFileList[45] = mExecutablePath + "/" + "../media/gfx/player2_head.png";
|
||||
|
||||
// Fuentes
|
||||
mFileList[27] = mExecutablePath + "/" + "../media/font/8bithud.png";
|
||||
mFileList[46] = mExecutablePath + "/" + "../media/font/8bithud.txt";
|
||||
mFileList[28] = mExecutablePath + "/" + "../media/font/nokia.png";
|
||||
mFileList[54] = mExecutablePath + "/" + "../media/font/nokia_big2.png";
|
||||
mFileList[52] = mExecutablePath + "/" + "../media/font/nokia.txt";
|
||||
mFileList[56] = mExecutablePath + "/" + "../media/font/nokia2.png";
|
||||
mFileList[57] = mExecutablePath + "/" + "../media/font/nokia2.txt";
|
||||
mFileList[55] = mExecutablePath + "/" + "../media/font/nokia_big2.txt";
|
||||
mFileList[29] = mExecutablePath + "/" + "../media/font/smb2_big.png";
|
||||
mFileList[47] = mExecutablePath + "/" + "../media/font/smb2_big.txt";
|
||||
mFileList[30] = mExecutablePath + "/" + "../media/font/smb2.png";
|
||||
mFileList[48] = mExecutablePath + "/" + "../media/font/smb2.txt";
|
||||
mFileList[0] = mExecutablePath + "/" + "../media/font/8bithud.png";
|
||||
mFileList[1] = mExecutablePath + "/" + "../media/font/8bithud.txt";
|
||||
mFileList[2] = mExecutablePath + "/" + "../media/font/nokia.png";
|
||||
mFileList[3] = mExecutablePath + "/" + "../media/font/nokia.txt";
|
||||
mFileList[4] = mExecutablePath + "/" + "../media/font/nokia2.png";
|
||||
mFileList[5] = mExecutablePath + "/" + "../media/font/nokia2.txt";
|
||||
mFileList[6] = mExecutablePath + "/" + "../media/font/smb2.png";
|
||||
mFileList[7] = mExecutablePath + "/" + "../media/font/smb2.txt";
|
||||
|
||||
// Textos
|
||||
mFileList[49] = mExecutablePath + "/" + "../media/lang/es_ES.txt";
|
||||
mFileList[50] = mExecutablePath + "/" + "../media/lang/en_UK.txt";
|
||||
mFileList[51] = mExecutablePath + "/" + "../media/lang/ba_BA.txt";
|
||||
mFileList[8] = mExecutablePath + "/" + "../media/lang/es_ES.txt";
|
||||
mFileList[9] = mExecutablePath + "/" + "../media/lang/en_UK.txt";
|
||||
mFileList[10] = mExecutablePath + "/" + "../media/lang/ba_BA.txt";
|
||||
|
||||
// DATA
|
||||
mFileList[53] = mExecutablePath + "/" + "../data/gamecontrollerdb.txt";
|
||||
mFileList[11] = mExecutablePath + "/" + "../data/gamecontrollerdb.txt";
|
||||
mFileList[12] = mExecutablePath + "/" + "../data/config.bin";
|
||||
}
|
||||
|
||||
// Comprueba los ficheros del vector de ficheros que coinciden con una ruta dada
|
||||
@@ -335,7 +284,7 @@ bool Director::loadConfigFile()
|
||||
// Indicador de éxito en la carga
|
||||
bool success = true;
|
||||
|
||||
const std::string p = mFileList[2];
|
||||
const std::string p = mFileList[12];
|
||||
std::string filename = p.substr(p.find_last_of("\\/") + 1);
|
||||
SDL_RWops *file = SDL_RWFromFile(p.c_str(), "r+b");
|
||||
|
||||
@@ -404,7 +353,7 @@ bool Director::loadConfigFile()
|
||||
bool Director::saveConfigFile()
|
||||
{
|
||||
bool success = true;
|
||||
const std::string p = mFileList[2];
|
||||
const std::string p = mFileList[12];
|
||||
std::string filename = p.substr(p.find_last_of("\\/") + 1);
|
||||
SDL_RWops *file = SDL_RWFromFile(p.c_str(), "w+b");
|
||||
if (file != NULL)
|
||||
@@ -469,6 +418,9 @@ void Director::runTitle()
|
||||
|
||||
void Director::runGame()
|
||||
{
|
||||
mGame = new Game(mRenderer, mFileList, mLang, mInput);
|
||||
setSection(mGame->run());
|
||||
delete mGame;
|
||||
}
|
||||
|
||||
void Director::run()
|
||||
|
||||
Reference in New Issue
Block a user