Añadida música al titulo
This commit is contained in:
@@ -3,16 +3,27 @@
|
||||
// Constructor
|
||||
Game::Game(SDL_Renderer *renderer, Screen *screen, Asset *asset, Input *input)
|
||||
{
|
||||
// Copia punteros
|
||||
this->renderer = renderer;
|
||||
this->asset = asset;
|
||||
this->screen = screen;
|
||||
this->input = input;
|
||||
|
||||
// Reserva memoria para los objetos
|
||||
eventHandler = new SDL_Event();
|
||||
map = new Map(asset->get("01.map"), renderer, asset);
|
||||
player = new Player(renderer, asset, input, map);
|
||||
debugText = new Text(asset->get("debug.png"), asset->get("debug.txt"), renderer);
|
||||
music = JA_LoadMusic(asset->get("music_surface.ogg").c_str());
|
||||
|
||||
// Inicializa variables
|
||||
ticks = 0;
|
||||
ticksSpeed = 15;
|
||||
|
||||
section.name = SECTION_PROG_GAME;
|
||||
section.subsection = SUBSECTION_GAME_PLAY;
|
||||
|
||||
debug = false;
|
||||
}
|
||||
|
||||
// Destructor
|
||||
@@ -28,8 +39,6 @@ Game::~Game()
|
||||
// Bucle para el juego
|
||||
section_t Game::run()
|
||||
{
|
||||
init();
|
||||
|
||||
JA_PlayMusic(music);
|
||||
|
||||
while (section.name == SECTION_PROG_GAME)
|
||||
@@ -47,18 +56,6 @@ section_t Game::run()
|
||||
return section;
|
||||
}
|
||||
|
||||
// Inicializa las variables necesarias para la sección 'Game'
|
||||
void Game::init()
|
||||
{
|
||||
ticks = 0;
|
||||
ticksSpeed = 15;
|
||||
|
||||
section.name = SECTION_PROG_GAME;
|
||||
section.subsection = SUBSECTION_GAME_PLAY;
|
||||
|
||||
debug = true;
|
||||
}
|
||||
|
||||
// Actualiza el juego, las variables, comprueba la entrada, etc.
|
||||
void Game::update()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user