Empezada la sección del titulo del juego
This commit is contained in:
49
source/title.h
Normal file
49
source/title.h
Normal file
@@ -0,0 +1,49 @@
|
||||
#pragma once
|
||||
|
||||
#include <SDL2/SDL.h>
|
||||
#include "const.h"
|
||||
#include "asset.h"
|
||||
#include "utils.h"
|
||||
#include "input.h"
|
||||
#include "screen.h"
|
||||
#include "text.h"
|
||||
#include "animatedsprite.h"
|
||||
#include "jail_audio.h"
|
||||
|
||||
#ifndef TITLE_H
|
||||
#define TITLE_H
|
||||
|
||||
// Clase Intro
|
||||
class Title
|
||||
{
|
||||
private:
|
||||
SDL_Renderer *renderer; // El renderizador de la ventana
|
||||
Screen *screen; // Objeto encargado de dibujar en pantalla
|
||||
LTexture *texture; // Textura con los graficos
|
||||
SDL_Event *eventHandler; // Manejador de eventos
|
||||
Asset *asset; // Objeto con los ficheros de recurso
|
||||
Input *input; // Objeto para gestionar las entradas
|
||||
Text *text; // Objeto para escribir texto en pantalla
|
||||
AnimatedSprite *sprite; // Sprite para dibujar los graficos de la intro
|
||||
section_t section; // Estado del bucle principal para saber si continua o se sale
|
||||
int ticks; // Contador de ticks para ajustar la velocidad del programa
|
||||
int ticksSpeed; // Velocidad a la que se repiten los bucles del programa
|
||||
|
||||
// Actualiza las variables
|
||||
void update();
|
||||
|
||||
// Dibuja en pantalla
|
||||
void render();
|
||||
|
||||
public:
|
||||
// Constructor
|
||||
Title(SDL_Renderer *renderer, Screen *screen, Asset *asset, Input *input);
|
||||
|
||||
// Destructor
|
||||
~Title();
|
||||
|
||||
// Bucle principal
|
||||
section_t run();
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user