nous grafics
@@ -18,8 +18,10 @@ scoreboard.w 320
|
|||||||
scoreboard.h 40
|
scoreboard.h 40
|
||||||
|
|
||||||
# TITLE
|
# TITLE
|
||||||
pressStart 160
|
pressStart 170
|
||||||
titleCounter 800
|
titleCounter 800
|
||||||
|
arcadeEdition 123
|
||||||
|
titleCC 80
|
||||||
|
|
||||||
# BACKGROUND
|
# BACKGROUND
|
||||||
backgroundAttenuateColor.r 255
|
backgroundAttenuateColor.r 255
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 833 B |
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
BIN
data/gfx/title_arcade_edition.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
@@ -223,3 +223,42 @@ hiScoreEntry_t sortHiScoreTable(hiScoreEntry_t entry1, hiScoreEntry_t entry2)
|
|||||||
|
|
||||||
return entry2;
|
return entry2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Dibuja un circulo
|
||||||
|
void DrawCircle(SDL_Renderer * renderer, int32_t centerX, int32_t centerY, int32_t radius)
|
||||||
|
{
|
||||||
|
const int32_t diameter = (radius * 2);
|
||||||
|
|
||||||
|
int32_t x = (radius - 1);
|
||||||
|
int32_t y = 0;
|
||||||
|
int32_t tx = 1;
|
||||||
|
int32_t ty = 1;
|
||||||
|
int32_t error = (tx - diameter);
|
||||||
|
|
||||||
|
while (x >= y)
|
||||||
|
{
|
||||||
|
// Each of the following renders an octant of the circle
|
||||||
|
SDL_RenderDrawPoint(renderer, centerX + x, centerY - y);
|
||||||
|
SDL_RenderDrawPoint(renderer, centerX + x, centerY + y);
|
||||||
|
SDL_RenderDrawPoint(renderer, centerX - x, centerY - y);
|
||||||
|
SDL_RenderDrawPoint(renderer, centerX - x, centerY + y);
|
||||||
|
SDL_RenderDrawPoint(renderer, centerX + y, centerY - x);
|
||||||
|
SDL_RenderDrawPoint(renderer, centerX + y, centerY + x);
|
||||||
|
SDL_RenderDrawPoint(renderer, centerX - y, centerY - x);
|
||||||
|
SDL_RenderDrawPoint(renderer, centerX - y, centerY + x);
|
||||||
|
|
||||||
|
if (error <= 0)
|
||||||
|
{
|
||||||
|
++y;
|
||||||
|
error += ty;
|
||||||
|
ty += 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (error > 0)
|
||||||
|
{
|
||||||
|
--x;
|
||||||
|
tx += 2;
|
||||||
|
error += (tx - diameter);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -196,6 +196,8 @@ struct param_t
|
|||||||
// TITLE
|
// TITLE
|
||||||
int pressStart; // Posición del texto para empezar a jugar
|
int pressStart; // Posición del texto para empezar a jugar
|
||||||
int titleCounter; // Tiempo de inactividad del titulo
|
int titleCounter; // Tiempo de inactividad del titulo
|
||||||
|
int arcadeEdition; // Posición del bitmap
|
||||||
|
int titleCC; // Posición del bitmap
|
||||||
|
|
||||||
// BACKGROUND
|
// BACKGROUND
|
||||||
color_t backgroundAttenuateColor;
|
color_t backgroundAttenuateColor;
|
||||||
@@ -249,4 +251,7 @@ JA_Music_t *getMusic(std::vector<music_file_t> music, std::string name);
|
|||||||
// Ordena las entradas de la tabla de records
|
// Ordena las entradas de la tabla de records
|
||||||
hiScoreEntry_t sortHiScoreTable(hiScoreEntry_t entry1, hiScoreEntry_t entry2);
|
hiScoreEntry_t sortHiScoreTable(hiScoreEntry_t entry1, hiScoreEntry_t entry2);
|
||||||
|
|
||||||
|
// Dibuja un circulo
|
||||||
|
void DrawCircle(SDL_Renderer *renderer, int32_t centerX, int32_t centerY, int32_t radius);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -360,6 +360,7 @@ bool Director::setFileList()
|
|||||||
asset->add(prefix + "/data/gfx/title_bg_tile.png", t_bitmap);
|
asset->add(prefix + "/data/gfx/title_bg_tile.png", t_bitmap);
|
||||||
asset->add(prefix + "/data/gfx/title_coffee.png", t_bitmap);
|
asset->add(prefix + "/data/gfx/title_coffee.png", t_bitmap);
|
||||||
asset->add(prefix + "/data/gfx/title_crisis.png", t_bitmap);
|
asset->add(prefix + "/data/gfx/title_crisis.png", t_bitmap);
|
||||||
|
asset->add(prefix + "/data/gfx/title_arcade_edition.png", t_bitmap);
|
||||||
asset->add(prefix + "/data/gfx/title_dust.png", t_bitmap);
|
asset->add(prefix + "/data/gfx/title_dust.png", t_bitmap);
|
||||||
asset->add(prefix + "/data/gfx/title_dust.ani", t_data);
|
asset->add(prefix + "/data/gfx/title_dust.ani", t_data);
|
||||||
|
|
||||||
|
|||||||
@@ -15,9 +15,11 @@ GameLogo::GameLogo(SDL_Renderer *renderer, Screen *screen, Asset *asset, param_t
|
|||||||
dustTexture = new Texture(renderer, asset->get("title_dust.png"));
|
dustTexture = new Texture(renderer, asset->get("title_dust.png"));
|
||||||
coffeeTexture = new Texture(renderer, asset->get("title_coffee.png"));
|
coffeeTexture = new Texture(renderer, asset->get("title_coffee.png"));
|
||||||
crisisTexture = new Texture(renderer, asset->get("title_crisis.png"));
|
crisisTexture = new Texture(renderer, asset->get("title_crisis.png"));
|
||||||
|
arcadeEditionTexture = new Texture(renderer, asset->get("title_arcade_edition.png"));
|
||||||
|
|
||||||
coffeeBitmap = new SmartSprite(coffeeTexture, renderer);
|
coffeeBitmap = new SmartSprite(coffeeTexture, renderer);
|
||||||
crisisBitmap = new SmartSprite(crisisTexture, renderer);
|
crisisBitmap = new SmartSprite(crisisTexture, renderer);
|
||||||
|
arcadeEditionBitmap = new Sprite((param->gameWidth - arcadeEditionTexture->getWidth()) / 2, param->arcadeEdition, arcadeEditionTexture->getWidth(), arcadeEditionTexture->getHeight(), arcadeEditionTexture, renderer);
|
||||||
dustBitmapL = new AnimatedSprite(dustTexture, renderer, asset->get("title_dust.ani"));
|
dustBitmapL = new AnimatedSprite(dustTexture, renderer, asset->get("title_dust.ani"));
|
||||||
dustBitmapR = new AnimatedSprite(dustTexture, renderer, asset->get("title_dust.ani"));
|
dustBitmapR = new AnimatedSprite(dustTexture, renderer, asset->get("title_dust.ani"));
|
||||||
|
|
||||||
@@ -31,17 +33,14 @@ GameLogo::GameLogo(SDL_Renderer *renderer, Screen *screen, Asset *asset, param_t
|
|||||||
// Destructor
|
// Destructor
|
||||||
GameLogo::~GameLogo()
|
GameLogo::~GameLogo()
|
||||||
{
|
{
|
||||||
dustTexture->unload();
|
|
||||||
delete dustTexture;
|
delete dustTexture;
|
||||||
|
|
||||||
coffeeTexture->unload();
|
|
||||||
delete coffeeTexture;
|
delete coffeeTexture;
|
||||||
|
|
||||||
crisisTexture->unload();
|
|
||||||
delete crisisTexture;
|
delete crisisTexture;
|
||||||
|
delete arcadeEditionTexture;
|
||||||
|
|
||||||
delete coffeeBitmap;
|
delete coffeeBitmap;
|
||||||
delete crisisBitmap;
|
delete crisisBitmap;
|
||||||
|
delete arcadeEditionBitmap;
|
||||||
delete dustBitmapL;
|
delete dustBitmapL;
|
||||||
delete dustBitmapR;
|
delete dustBitmapR;
|
||||||
|
|
||||||
@@ -117,6 +116,9 @@ void GameLogo::render()
|
|||||||
coffeeBitmap->render();
|
coffeeBitmap->render();
|
||||||
crisisBitmap->render();
|
crisisBitmap->render();
|
||||||
|
|
||||||
|
if (status == finished)
|
||||||
|
arcadeEditionBitmap->render();
|
||||||
|
|
||||||
// Dibuja el polvillo del logo
|
// Dibuja el polvillo del logo
|
||||||
dustBitmapR->render();
|
dustBitmapR->render();
|
||||||
dustBitmapL->render();
|
dustBitmapL->render();
|
||||||
|
|||||||
@@ -20,14 +20,17 @@ private:
|
|||||||
Asset *asset; // Objeto que gestiona todos los ficheros de recursos
|
Asset *asset; // Objeto que gestiona todos los ficheros de recursos
|
||||||
|
|
||||||
Texture *dustTexture; // Textura con los graficos del polvo
|
Texture *dustTexture; // Textura con los graficos del polvo
|
||||||
Texture *coffeeTexture; // Textura con los graficos de la palabra coffee
|
Texture *coffeeTexture; // Textura con los graficos de la palabra "COFFEE"
|
||||||
Texture *crisisTexture; // Textura con los graficos de la plabra crisis
|
Texture *crisisTexture; // Textura con los graficos de la plabra "CRISIS"
|
||||||
|
Texture *arcadeEditionTexture; // Textura con los graficos de "Arcade Edition"
|
||||||
|
|
||||||
AnimatedSprite *dustBitmapL; // Sprite con la el polvo que aparece al colisionar el texto de la pantalla de titulo
|
AnimatedSprite *dustBitmapL; // Sprite con la el polvo que aparece al colisionar el texto de la pantalla de titulo
|
||||||
AnimatedSprite *dustBitmapR; // Sprite con la el polvo que aparece al colisionar el texto de la pantalla de titulo
|
AnimatedSprite *dustBitmapR; // Sprite con la el polvo que aparece al colisionar el texto de la pantalla de titulo
|
||||||
|
|
||||||
SmartSprite *coffeeBitmap; // Sprite con la palabra COFFEE para la pantalla de titulo
|
SmartSprite *coffeeBitmap; // Sprite con la palabra "COFFEE" para la pantalla de titulo
|
||||||
SmartSprite *crisisBitmap; // Sprite con la palabra CRISIS para la pantalla de titulo
|
SmartSprite *crisisBitmap; // Sprite con la palabra "CRISIS" para la pantalla de titulo
|
||||||
|
|
||||||
|
Sprite *arcadeEditionBitmap; // Sprite con los graficos de "Arcade Edition"
|
||||||
|
|
||||||
JA_Sound_t *crashSound; // Sonido con el impacto del título
|
JA_Sound_t *crashSound; // Sonido con el impacto del título
|
||||||
param_t *param; // Puntero con todos los parametros del programa
|
param_t *param; // Puntero con todos los parametros del programa
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ void initParam(param_t *param)
|
|||||||
// TITLE
|
// TITLE
|
||||||
param->pressStart = 160;
|
param->pressStart = 160;
|
||||||
param->titleCounter = 800;
|
param->titleCounter = 800;
|
||||||
|
param->arcadeEdition = 123;
|
||||||
|
param->titleCC = 11;
|
||||||
|
|
||||||
// BACKGROUND
|
// BACKGROUND
|
||||||
param->backgroundAttenuateColor = {255, 255, 255};
|
param->backgroundAttenuateColor = {255, 255, 255};
|
||||||
@@ -205,6 +207,16 @@ bool setOptions(param_t *param, std::string var, std::string value)
|
|||||||
param->titleCounter = std::stoi(value);
|
param->titleCounter = std::stoi(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else if (var == "arcadeEdition")
|
||||||
|
{
|
||||||
|
param->arcadeEdition = std::stoi(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (var == "titleCC")
|
||||||
|
{
|
||||||
|
param->titleCC = std::stoi(value);
|
||||||
|
}
|
||||||
|
|
||||||
// BACKGROUND
|
// BACKGROUND
|
||||||
else if (var == "backgroundAttenuateColor.r")
|
else if (var == "backgroundAttenuateColor.r")
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -161,6 +161,9 @@ void Player::render()
|
|||||||
}
|
}
|
||||||
|
|
||||||
playerSprite->render();
|
playerSprite->render();
|
||||||
|
|
||||||
|
//SDL_SetRenderDrawColor(renderer, 255, 255, 255, 255);
|
||||||
|
//DrawCircle(renderer, collider.x, collider.y, collider.r);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Establece el estado del jugador cuando camina
|
// Establece el estado del jugador cuando camina
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ Title::Title(SDL_Renderer *renderer, Screen *screen, Input *input, Asset *asset,
|
|||||||
|
|
||||||
tiledbg = new Tiledbg(renderer, screen, asset, {0, 0, param->gameWidth, param->gameHeight}, TILED_MODE_RANDOM);
|
tiledbg = new Tiledbg(renderer, screen, asset, {0, 0, param->gameWidth, param->gameHeight}, TILED_MODE_RANDOM);
|
||||||
|
|
||||||
gameLogo = new GameLogo(renderer, screen, asset, param, GAMECANVAS_CENTER_X, GAMECANVAS_FIRST_QUARTER_Y + 20);
|
gameLogo = new GameLogo(renderer, screen, asset, param, GAMECANVAS_CENTER_X, param->titleCC);
|
||||||
gameLogo->enable();
|
gameLogo->enable();
|
||||||
|
|
||||||
defineButtons = new DefineButtons(renderer, input, text2, param, options, section);
|
defineButtons = new DefineButtons(renderer, input, text2, param, options, section);
|
||||||
|
|||||||