Definidas areas para cada zona del juego
This commit is contained in:
@@ -8,6 +8,22 @@ Background::Background(SDL_Renderer *renderer, Screen *screen, Asset *asset)
|
|||||||
this->screen = screen;
|
this->screen = screen;
|
||||||
this->asset = asset;
|
this->asset = asset;
|
||||||
|
|
||||||
|
// Inicializa variables
|
||||||
|
gradientNumber = 0;
|
||||||
|
alpha = 0;
|
||||||
|
cloudsSpeed = 0;
|
||||||
|
transition = 0;
|
||||||
|
counter = 0;
|
||||||
|
rect = {0, 0, GAMECANVAS_WIDTH, GAMECANVAS_HEIGHT};
|
||||||
|
srcRect = {0, rect.h - playArea.h, playArea.w, playArea.h};
|
||||||
|
dstRect = playArea;
|
||||||
|
base = rect.h;
|
||||||
|
|
||||||
|
gradientRect[0] = {0, 0, rect.w, rect.h};
|
||||||
|
gradientRect[1] = {256, 0, rect.w, rect.h};
|
||||||
|
gradientRect[2] = {0, 192, rect.w, rect.h};
|
||||||
|
gradientRect[3] = {256, 192, rect.w, rect.h};
|
||||||
|
|
||||||
// Carga las texturas
|
// Carga las texturas
|
||||||
buildingsTexture = new Texture(renderer, asset->get("game_buildings.png"));
|
buildingsTexture = new Texture(renderer, asset->get("game_buildings.png"));
|
||||||
cloudsTexture = new Texture(renderer, asset->get("game_clouds.png"));
|
cloudsTexture = new Texture(renderer, asset->get("game_clouds.png"));
|
||||||
@@ -15,32 +31,26 @@ Background::Background(SDL_Renderer *renderer, Screen *screen, Asset *asset)
|
|||||||
gradientsTexture = new Texture(renderer, asset->get("game_sky_colors.png"));
|
gradientsTexture = new Texture(renderer, asset->get("game_sky_colors.png"));
|
||||||
|
|
||||||
// Crea los sprites
|
// Crea los sprites
|
||||||
clouds1A = new MovingSprite(0, 0, 256, 52, -0.4f, 0.0f, 0.0f, 0.0f, cloudsTexture, renderer);
|
clouds1A = new MovingSprite(0, base - 155, 256, 52, -0.4f, 0.0f, 0.0f, 0.0f, cloudsTexture, renderer);
|
||||||
clouds1B = new MovingSprite(256, 0, 256, 52, -0.4f, 0.0f, 0.0f, 0.0f, cloudsTexture, renderer);
|
clouds1B = new MovingSprite(256, base - 155, 256, 52, -0.4f, 0.0f, 0.0f, 0.0f, cloudsTexture, renderer);
|
||||||
clouds2A = new MovingSprite(0, 52, 256, 32, -0.2f, 0.0f, 0.0f, 0.0f, cloudsTexture, renderer);
|
clouds2A = new MovingSprite(0, base - 155 + 57, 256, 32, -0.2f, 0.0f, 0.0f, 0.0f, cloudsTexture, renderer);
|
||||||
clouds2B = new MovingSprite(256, 52, 256, 32, -0.2f, 0.0f, 0.0f, 0.0f, cloudsTexture, renderer);
|
clouds2B = new MovingSprite(256, base - 155 + 57, 256, 32, -0.2f, 0.0f, 0.0f, 0.0f, cloudsTexture, renderer);
|
||||||
|
|
||||||
buildingsSprite = new Sprite(0, 0, 256, 160, buildingsTexture, renderer);
|
buildingsSprite = new Sprite(0, 0, 256, 160, buildingsTexture, renderer);
|
||||||
gradientSprite = new Sprite(0, 0, GAMECANVAS_WIDTH, GAMECANVAS_HEIGHT, gradientsTexture, renderer);
|
gradientSprite = new Sprite(0, 0, 256, 192, gradientsTexture, renderer);
|
||||||
grassSprite = new Sprite(0, 0, 256, 6, grassTexture, renderer);
|
grassSprite = new Sprite(0, 0, 256, 6, grassTexture, renderer);
|
||||||
|
|
||||||
// Inicializa variables
|
// Inicializa objetos
|
||||||
clouds1A->setSpriteClip(0, 0, 256, 52);
|
clouds1A->setSpriteClip(0, 0, 256, 52);
|
||||||
clouds1B->setSpriteClip(0, 0, 256, 52);
|
clouds1B->setSpriteClip(0, 0, 256, 52);
|
||||||
clouds2A->setSpriteClip(0, 52, 256, 32);
|
clouds2A->setSpriteClip(0, 52, 256, 32);
|
||||||
clouds2B->setSpriteClip(0, 52, 256, 32);
|
clouds2B->setSpriteClip(0, 52, 256, 32);
|
||||||
grassSprite->setPosY(154);
|
buildingsSprite->setPosY(base - buildingsSprite->getHeight());
|
||||||
|
grassSprite->setPosY(base - grassSprite->getHeight());
|
||||||
|
|
||||||
gradientRect[0] = {0, 0, GAMECANVAS_WIDTH, GAMECANVAS_HEIGHT};
|
// Crea la textura para componer el fondo
|
||||||
gradientRect[1] = {256, 0, GAMECANVAS_WIDTH, GAMECANVAS_HEIGHT};
|
canvas = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET, rect.w, rect.h);
|
||||||
gradientRect[2] = {0, 192, GAMECANVAS_WIDTH, GAMECANVAS_HEIGHT};
|
SDL_SetTextureBlendMode(canvas, SDL_BLENDMODE_BLEND);
|
||||||
gradientRect[3] = {256, 192, GAMECANVAS_WIDTH, GAMECANVAS_HEIGHT};
|
|
||||||
|
|
||||||
gradientNumber = 0;
|
|
||||||
alpha = 0;
|
|
||||||
cloudsSpeed = 0;
|
|
||||||
transition = 0;
|
|
||||||
counter = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
@@ -65,6 +75,7 @@ Background::~Background()
|
|||||||
delete buildingsSprite;
|
delete buildingsSprite;
|
||||||
delete gradientSprite;
|
delete gradientSprite;
|
||||||
delete grassSprite;
|
delete grassSprite;
|
||||||
|
SDL_DestroyTexture(canvas);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Actualiza la lógica del objeto
|
// Actualiza la lógica del objeto
|
||||||
@@ -113,9 +124,13 @@ void Background::update()
|
|||||||
counter++;
|
counter++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dibuja el objeto
|
// Compone todos los elementos del fondo en la textura
|
||||||
void Background::render()
|
void Background::fillCanvas()
|
||||||
{
|
{
|
||||||
|
// Cambia el destino del renderizador
|
||||||
|
SDL_Texture *temp = SDL_GetRenderTarget(renderer);
|
||||||
|
SDL_SetRenderTarget(renderer, canvas);
|
||||||
|
|
||||||
// Dibuja el gradiente 2
|
// Dibuja el gradiente 2
|
||||||
gradientSprite->setSpriteClip(gradientRect[(gradientNumber + 1) % 4]);
|
gradientSprite->setSpriteClip(gradientRect[(gradientNumber + 1) % 4]);
|
||||||
gradientsTexture->setAlpha(255);
|
gradientsTexture->setAlpha(255);
|
||||||
@@ -137,6 +152,16 @@ void Background::render()
|
|||||||
|
|
||||||
// Dibuja la hierba
|
// Dibuja la hierba
|
||||||
grassSprite->render();
|
grassSprite->render();
|
||||||
|
|
||||||
|
// Deja el renderizador apuntando donde estaba
|
||||||
|
SDL_SetRenderTarget(renderer, temp);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Dibuja el objeto
|
||||||
|
void Background::render()
|
||||||
|
{
|
||||||
|
fillCanvas();
|
||||||
|
SDL_RenderCopy(renderer, canvas, &srcRect, &dstRect);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Vuelve a cargar las texturas
|
// Vuelve a cargar las texturas
|
||||||
@@ -164,4 +189,14 @@ void Background::setGradientNumber(int value)
|
|||||||
void Background::setTransition(float value)
|
void Background::setTransition(float value)
|
||||||
{
|
{
|
||||||
transition = value;
|
transition = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Establece la posición del objeto
|
||||||
|
void Background::setPos(SDL_Rect rect)
|
||||||
|
{
|
||||||
|
dstRect = rect;
|
||||||
|
|
||||||
|
// Si cambian las medidas del destino, hay que cambiar las del origen para evitar deformar la imagen
|
||||||
|
srcRect.w = rect.w;
|
||||||
|
srcRect.h = rect.h;
|
||||||
}
|
}
|
||||||
@@ -21,9 +21,14 @@ private:
|
|||||||
SDL_Rect gradientRect[4]; // Vector con las coordenadas de los 4 degradados para el cielo
|
SDL_Rect gradientRect[4]; // Vector con las coordenadas de los 4 degradados para el cielo
|
||||||
int gradientNumber; // Indica el número de degradado de fondo que se va a dibujar
|
int gradientNumber; // Indica el número de degradado de fondo que se va a dibujar
|
||||||
int alpha; // Transparencia entre los dos degradados
|
int alpha; // Transparencia entre los dos degradados
|
||||||
float cloudsSpeed; // Velocidad a la que se desplazan las nubes
|
float cloudsSpeed; // Velocidad a la que se desplazan las nubes
|
||||||
float transition; // Nivel de transición del fondo 0..1
|
float transition; // Nivel de transición del fondo 0..1
|
||||||
int counter; // Contador interno
|
int counter; // Contador interno
|
||||||
|
SDL_Rect rect; // Tamaño del objeto fondo
|
||||||
|
SDL_Rect srcRect; // Parte del objeto fondo que se va a dibujará en pantalla
|
||||||
|
SDL_Rect dstRect; // Posición donde dibujar la parte del objeto fondo que se dibujará en pantalla
|
||||||
|
SDL_Texture *canvas; // Textura para componer el fondo
|
||||||
|
int base; // Linea de fondo coincidente con el area inferior de la zona de juego
|
||||||
|
|
||||||
Texture *buildingsTexture; // Textura con los edificios de fondo
|
Texture *buildingsTexture; // Textura con los edificios de fondo
|
||||||
Texture *cloudsTexture; // Textura con las nubes de fondo
|
Texture *cloudsTexture; // Textura con las nubes de fondo
|
||||||
@@ -39,6 +44,9 @@ private:
|
|||||||
Sprite *gradientSprite; // Sprite con los graficos del degradado de color de fondo
|
Sprite *gradientSprite; // Sprite con los graficos del degradado de color de fondo
|
||||||
Sprite *grassSprite; // Sprite para la hierba
|
Sprite *grassSprite; // Sprite para la hierba
|
||||||
|
|
||||||
|
// Compone todos los elementos del fondo en la textura
|
||||||
|
void fillCanvas();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
Background(SDL_Renderer *renderer, Screen *screen, Asset *asset);
|
Background(SDL_Renderer *renderer, Screen *screen, Asset *asset);
|
||||||
@@ -52,6 +60,9 @@ public:
|
|||||||
// Dibuja el objeto
|
// Dibuja el objeto
|
||||||
void render();
|
void render();
|
||||||
|
|
||||||
|
// Establece la posición del objeto
|
||||||
|
void setPos(SDL_Rect);
|
||||||
|
|
||||||
// Vuelve a cargar las texturas
|
// Vuelve a cargar las texturas
|
||||||
void reloadTextures();
|
void reloadTextures();
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
#include <SDL2/SDL.h>
|
#include <SDL2/SDL.h>
|
||||||
#include "common/utils.h"
|
#include "common/utils.h"
|
||||||
#include "lang.h"
|
|
||||||
|
|
||||||
#ifndef CONST_H
|
#ifndef CONST_H
|
||||||
#define CONST_H
|
#define CONST_H
|
||||||
@@ -11,20 +10,24 @@
|
|||||||
#define BLOCK 8
|
#define BLOCK 8
|
||||||
#define HALF_BLOCK BLOCK / 2
|
#define HALF_BLOCK BLOCK / 2
|
||||||
|
|
||||||
// Tamaño de la pantalla virtual
|
// Resolución nativa del juego
|
||||||
#define GAMECANVAS_WIDTH 256
|
#define GAMECANVAS_WIDTH 256
|
||||||
#define GAMECANVAS_HEIGHT 192
|
#define GAMECANVAS_HEIGHT 192
|
||||||
|
|
||||||
// Marcador
|
// Marcador
|
||||||
const int SCOREBOARD_HEIGHT = (4 * BLOCK);
|
const int SCOREBOARD_WIDTH = GAMECANVAS_WIDTH;
|
||||||
|
const int SCOREBOARD_HEIGHT = 32;
|
||||||
|
const int SCOREBOARD_X = 0;
|
||||||
|
const int SCOREBOARD_Y = GAMECANVAS_HEIGHT - SCOREBOARD_HEIGHT;
|
||||||
|
|
||||||
// Zona de juego
|
// Zona de juego
|
||||||
const int PLAY_AREA_TOP = (0 * BLOCK);
|
const SDL_Rect playArea = {0, 0, GAMECANVAS_WIDTH, GAMECANVAS_HEIGHT - SCOREBOARD_HEIGHT};
|
||||||
const int PLAY_AREA_BOTTOM = GAMECANVAS_HEIGHT - SCOREBOARD_HEIGHT;
|
const int PLAY_AREA_TOP = playArea.y;
|
||||||
const int PLAY_AREA_LEFT = (0 * BLOCK);
|
const int PLAY_AREA_BOTTOM = playArea.y + playArea.h;
|
||||||
const int PLAY_AREA_RIGHT = GAMECANVAS_WIDTH - (0 * BLOCK);
|
const int PLAY_AREA_LEFT = playArea.x;
|
||||||
const int PLAY_AREA_WIDTH = PLAY_AREA_RIGHT - PLAY_AREA_LEFT;
|
const int PLAY_AREA_RIGHT = playArea.x + playArea.w;
|
||||||
const int PLAY_AREA_HEIGHT = PLAY_AREA_BOTTOM - PLAY_AREA_TOP;
|
const int PLAY_AREA_WIDTH = playArea.w;
|
||||||
|
const int PLAY_AREA_HEIGHT = playArea.h;
|
||||||
const int PLAY_AREA_CENTER_X = PLAY_AREA_LEFT + (PLAY_AREA_WIDTH / 2);
|
const int PLAY_AREA_CENTER_X = PLAY_AREA_LEFT + (PLAY_AREA_WIDTH / 2);
|
||||||
const int PLAY_AREA_CENTER_FIRST_QUARTER_X = (PLAY_AREA_WIDTH / 4);
|
const int PLAY_AREA_CENTER_FIRST_QUARTER_X = (PLAY_AREA_WIDTH / 4);
|
||||||
const int PLAY_AREA_CENTER_THIRD_QUARTER_X = (PLAY_AREA_WIDTH / 4) * 3;
|
const int PLAY_AREA_CENTER_THIRD_QUARTER_X = (PLAY_AREA_WIDTH / 4) * 3;
|
||||||
@@ -64,5 +67,10 @@ const int GAMECANVAS_THIRD_QUARTER_Y = (GAMECANVAS_HEIGHT / 4) * 3;
|
|||||||
const color_t bgColor = {0x27, 0x27, 0x36};
|
const color_t bgColor = {0x27, 0x27, 0x36};
|
||||||
const color_t noColor = {0xFF, 0xFF, 0xFF};
|
const color_t noColor = {0xFF, 0xFF, 0xFF};
|
||||||
const color_t shdwTxtColor = {0x43, 0x43, 0x4F};
|
const color_t shdwTxtColor = {0x43, 0x43, 0x4F};
|
||||||
|
const color_t separator = {0x0D, 0x1A, 0x2B};
|
||||||
|
const color_t scoreboardColor = {46, 63, 71};
|
||||||
|
const color_t difficultyEasyColor = {75, 105, 47};
|
||||||
|
const color_t difficultyNormalColor = {255, 122, 0};
|
||||||
|
const color_t difficultyHardColor = {118, 66, 138};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -194,41 +194,34 @@ void Game::init()
|
|||||||
case DIFFICULTY_EASY:
|
case DIFFICULTY_EASY:
|
||||||
defaultEnemySpeed = BALLOON_SPEED_1;
|
defaultEnemySpeed = BALLOON_SPEED_1;
|
||||||
difficultyScoreMultiplier = 0.5f;
|
difficultyScoreMultiplier = 0.5f;
|
||||||
difficultyColor = {75, 105, 47};
|
difficultyColor = difficultyEasyColor;
|
||||||
pauseMenu->setSelectorColor(difficultyColor, 255);
|
scoreboard->setColor(difficultyColor);
|
||||||
gameOverMenu->setSelectorColor(difficultyColor, 255);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DIFFICULTY_NORMAL:
|
case DIFFICULTY_NORMAL:
|
||||||
defaultEnemySpeed = BALLOON_SPEED_1;
|
defaultEnemySpeed = BALLOON_SPEED_1;
|
||||||
difficultyScoreMultiplier = 1.0f;
|
difficultyScoreMultiplier = 1.0f;
|
||||||
difficultyColor = {255, 122, 0};
|
difficultyColor = difficultyNormalColor;
|
||||||
pauseMenu->setSelectorColor(difficultyColor, 255);
|
scoreboard->setColor(scoreboardColor);
|
||||||
gameOverMenu->setSelectorColor(difficultyColor, 255);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DIFFICULTY_HARD:
|
case DIFFICULTY_HARD:
|
||||||
defaultEnemySpeed = BALLOON_SPEED_5;
|
defaultEnemySpeed = BALLOON_SPEED_5;
|
||||||
difficultyScoreMultiplier = 1.5f;
|
difficultyScoreMultiplier = 1.5f;
|
||||||
difficultyColor = {118, 66, 138};
|
difficultyColor = difficultyHardColor;
|
||||||
pauseMenu->setSelectorColor(difficultyColor, 255);
|
scoreboard->setColor(difficultyColor);
|
||||||
gameOverMenu->setSelectorColor(difficultyColor, 255);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Colores
|
||||||
|
pauseMenu->setSelectorColor(difficultyColor, 255);
|
||||||
|
gameOverMenu->setSelectorColor(difficultyColor, 255);
|
||||||
|
|
||||||
// Variables para el marcador
|
// Variables para el marcador
|
||||||
scoreboard->setPos({PLAY_AREA_LEFT, PLAY_AREA_BOTTOM, PLAY_AREA_WIDTH, SCOREBOARD_HEIGHT});
|
scoreboard->setPos({SCOREBOARD_X, SCOREBOARD_Y, SCOREBOARD_WIDTH, SCOREBOARD_HEIGHT});
|
||||||
if (difficulty == DIFFICULTY_NORMAL)
|
|
||||||
{
|
|
||||||
scoreboard->setColor({46, 63, 71});
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
scoreboard->setColor(difficultyColor);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Resto de variables
|
// Resto de variables
|
||||||
gameCompleted = false;
|
gameCompleted = false;
|
||||||
@@ -2690,7 +2683,7 @@ void Game::updateBackground()
|
|||||||
void Game::renderSeparator()
|
void Game::renderSeparator()
|
||||||
{
|
{
|
||||||
// Dibuja la linea que separa el marcador de la zona de juego
|
// Dibuja la linea que separa el marcador de la zona de juego
|
||||||
SDL_SetRenderDrawColor(renderer, 13, 26, 43, 255);
|
SDL_SetRenderDrawColor(renderer, separator.r, separator.g, separator.b, 255);
|
||||||
SDL_RenderDrawLine(renderer, PLAY_AREA_LEFT, PLAY_AREA_BOTTOM, PLAY_AREA_RIGHT, PLAY_AREA_BOTTOM);
|
SDL_RenderDrawLine(renderer, PLAY_AREA_LEFT, PLAY_AREA_BOTTOM, PLAY_AREA_RIGHT, PLAY_AREA_BOTTOM);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2705,11 +2698,11 @@ void Game::render()
|
|||||||
|
|
||||||
// Dibuja los objetos
|
// Dibuja los objetos
|
||||||
background->render();
|
background->render();
|
||||||
|
renderItems();
|
||||||
|
renderSmartSprites();
|
||||||
renderBalloons();
|
renderBalloons();
|
||||||
renderBullets();
|
renderBullets();
|
||||||
renderMessages();
|
renderMessages();
|
||||||
renderItems();
|
|
||||||
renderSmartSprites();
|
|
||||||
scoreboard->render();
|
scoreboard->render();
|
||||||
renderSeparator();
|
renderSeparator();
|
||||||
renderPlayers();
|
renderPlayers();
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
#include "player.h"
|
#include "player.h"
|
||||||
#include "scoreboard.h"
|
#include "scoreboard.h"
|
||||||
#include "background.h"
|
#include "background.h"
|
||||||
|
#include "lang.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#ifndef GAME_H
|
#ifndef GAME_H
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
#include "common/text.h"
|
#include "common/text.h"
|
||||||
#include "common/utils.h"
|
#include "common/utils.h"
|
||||||
#include "const.h"
|
#include "const.h"
|
||||||
|
#include "lang.h"
|
||||||
|
|
||||||
#ifndef HISCORE_TABLE_H
|
#ifndef HISCORE_TABLE_H
|
||||||
#define HISCORE_TABLE_H
|
#define HISCORE_TABLE_H
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
#include "common/text.h"
|
#include "common/text.h"
|
||||||
#include "common/utils.h"
|
#include "common/utils.h"
|
||||||
#include "const.h"
|
#include "const.h"
|
||||||
|
#include "lang.h"
|
||||||
|
|
||||||
#ifndef INSTRUCTIONS_H
|
#ifndef INSTRUCTIONS_H
|
||||||
#define INSTRUCTIONS_H
|
#define INSTRUCTIONS_H
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
#include "common/utils.h"
|
#include "common/utils.h"
|
||||||
#include "common/writer.h"
|
#include "common/writer.h"
|
||||||
#include "const.h"
|
#include "const.h"
|
||||||
|
#include "lang.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#ifndef INTRO_H
|
#ifndef INTRO_H
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ Scoreboard::Scoreboard(SDL_Renderer *renderer, Screen *screen, Asset *asset, Lan
|
|||||||
powerMeterSprite = new Sprite(offsetPowerMeter.x - 20, offsetPowerMeter.y, 40, 7, gamePowerMeterTexture, renderer);
|
powerMeterSprite = new Sprite(offsetPowerMeter.x - 20, offsetPowerMeter.y, 40, 7, gamePowerMeterTexture, renderer);
|
||||||
textScoreBoard = new Text(asset->get("8bithud.png"), asset->get("8bithud.txt"), renderer);
|
textScoreBoard = new Text(asset->get("8bithud.png"), asset->get("8bithud.txt"), renderer);
|
||||||
|
|
||||||
// Crea la textura dibujar el marcador
|
// Crea la textura para dibujar el marcador
|
||||||
background = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET, rect.w, rect.h);
|
background = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET, rect.w, rect.h);
|
||||||
SDL_SetTextureBlendMode(background, SDL_BLENDMODE_BLEND);
|
SDL_SetTextureBlendMode(background, SDL_BLENDMODE_BLEND);
|
||||||
|
|
||||||
@@ -245,6 +245,6 @@ void Scoreboard::fillBackgroundTexture()
|
|||||||
textScoreBoard->writeCentered(offsetHiScoreLabel.x, offsetHiScoreLabel.y, lang->getText(56));
|
textScoreBoard->writeCentered(offsetHiScoreLabel.x, offsetHiScoreLabel.y, lang->getText(56));
|
||||||
textScoreBoard->writeCentered(offsetHiScore.x, offsetHiScore.y, hiScoreName + updateScoreText(hiScore));
|
textScoreBoard->writeCentered(offsetHiScore.x, offsetHiScore.y, hiScoreName + updateScoreText(hiScore));
|
||||||
|
|
||||||
// Deja el renderizador apuntando a la pantalla
|
// Deja el renderizador apuntando donde estaba
|
||||||
SDL_SetRenderTarget(renderer, temp);
|
SDL_SetRenderTarget(renderer, temp);
|
||||||
}
|
}
|
||||||
@@ -13,6 +13,7 @@
|
|||||||
#include "common/utils.h"
|
#include "common/utils.h"
|
||||||
#include "common/writer.h"
|
#include "common/writer.h"
|
||||||
#include "const.h"
|
#include "const.h"
|
||||||
|
#include "lang.h"
|
||||||
|
|
||||||
#ifndef SCOREBOARD_H
|
#ifndef SCOREBOARD_H
|
||||||
#define SCOREBOARD_H
|
#define SCOREBOARD_H
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
#include "hiscore_table.h"
|
#include "hiscore_table.h"
|
||||||
#include "instructions.h"
|
#include "instructions.h"
|
||||||
#include "item.h"
|
#include "item.h"
|
||||||
|
#include "lang.h"
|
||||||
|
|
||||||
#ifndef TITLE_H
|
#ifndef TITLE_H
|
||||||
#define TITLE_H
|
#define TITLE_H
|
||||||
|
|||||||
9
todo.txt
9
todo.txt
@@ -1,4 +1,9 @@
|
|||||||
[] Cargar todos los graficos al inicio
|
[] Cargar todos los graficos al inicio
|
||||||
[] Independizar el pintado del fondo del juego
|
[x] Independizar el pintado del fondo del juego
|
||||||
[] Cambiar la resolución a 320x240
|
[] Cambiar la resolución a 320x240
|
||||||
[] Permitir entrar al segundo jugador en caliente
|
[] Permitir entrar al segundo jugador en caliente
|
||||||
|
[] Arreglar la pantalla de titulo
|
||||||
|
[] Hacer el marcador transparente
|
||||||
|
[] Valorar la opcion de que write devuelva texturas con el texto en lugar de pintar letra a letra
|
||||||
|
[] Arreglar los anclajes en la pantalla de game over
|
||||||
|
[] Al poner pausa, que se sigan moviendo las nubes
|
||||||
Reference in New Issue
Block a user