forked from jaildesigner-jailgames/jaildoctors_dilemma
Añadido el esqueleto para dos secciones nuevas: ending y game_over
This commit is contained in:
59
source/ending.h
Normal file
59
source/ending.h
Normal file
@@ -0,0 +1,59 @@
|
||||
#pragma once
|
||||
#include <SDL2/SDL.h>
|
||||
#include "common/animatedsprite.h"
|
||||
#include "common/asset.h"
|
||||
#include "common/jail_audio.h"
|
||||
#include "common/resource.h"
|
||||
#include "common/screen.h"
|
||||
#include "common/sprite.h"
|
||||
#include "common/text.h"
|
||||
#include "common/texture.h"
|
||||
#include "common/utils.h"
|
||||
#include "const.h"
|
||||
#include <vector>
|
||||
|
||||
#ifndef ENDING_H
|
||||
#define ENDING_H
|
||||
|
||||
class Ending
|
||||
{
|
||||
private:
|
||||
// Objetos y punteros
|
||||
SDL_Renderer *renderer; // El renderizador de la ventana
|
||||
Screen *screen; // Objeto encargado de dibujar en pantalla
|
||||
Resource *resource; // Objeto con los recursos
|
||||
Asset *asset; // Objeto con los ficheros de recursos
|
||||
options_t *options; // Puntero a las opciones del juego
|
||||
SDL_Event *eventHandler; // Manejador de eventos
|
||||
Text *text; // Objeto para escribir texto en pantalla
|
||||
SDL_Texture *textTexture; // Textura para dibujar el texto
|
||||
SDL_Texture *coverTexture; // Textura para cubrir el texto
|
||||
AnimatedSprite *sprite; // Sprite para el brillo del corazón
|
||||
|
||||
// Variables
|
||||
int counter; // Contador
|
||||
section_t section; // Estado del bucle principal para saber si continua o se sale
|
||||
Uint32 ticks; // Contador de ticks para ajustar la velocidad del programa
|
||||
Uint32 ticksSpeed; // Velocidad a la que se repiten los bucles del programa
|
||||
|
||||
// Actualiza el objeto
|
||||
void update();
|
||||
|
||||
// Dibuja el final en pantalla
|
||||
void render();
|
||||
|
||||
// Comprueba el manejador de eventos
|
||||
void checkEventHandler();
|
||||
|
||||
public:
|
||||
// Constructor
|
||||
Ending(SDL_Renderer *renderer, Screen *screen, Resource *resource, Asset *asset, options_t *options);
|
||||
|
||||
// Destructor
|
||||
~Ending();
|
||||
|
||||
// Bucle principal
|
||||
section_t run();
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user