10 Commits

15 changed files with 263 additions and 60 deletions

View File

@@ -3,7 +3,7 @@
# box height
10
# 32 espacio ( )
7
5
# 33 !
4
# 34 "

BIN
media/font/nokia2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

194
media/font/nokia2.txt Normal file
View File

@@ -0,0 +1,194 @@
# box width
10
# box height
10
# 32 espacio ( )
5
# 33 !
4
# 34 "
5
# 35 #
7
# 36 $
7
# 37 %
8
# 38 &
8
# 39 '
3
# 40 (
5
# 41 )
5
# 42 *
7
# 43 +
7
# 44 ,
4
# 45 -
6
# 46 .
4
# 47 /
5
# 48 0
7
# 49 1
5
# 50 2
7
# 51 3
7
# 52 4
7
# 53 5
7
# 54 6
7
# 55 7
7
# 56 8
7
# 57 9
7
# 58 :
4
# 59 ;
4
# 60 <
6
# 61 =
6
# 62 >
6
# 63 ?
7
# 64 @
8
# 65 A
7
# 66 B
7
# 67 C
7
# 68 D
7
# 69 E
7
# 70 F
7
# 71 G
7
# 72 H
7
# 73 I
4
# 74 J
6
# 75 K
8
# 76 L
6
# 77 M
9
# 78 N
8
# 79 O
8
# 80 P
7
# 81 Q
8
# 82 R
7
# 83 S
6
# 84 T
8
# 85 U
7
# 86 V
8
# 87 W
9
# 88 X
8
# 89 Y
8
# 90 Z
7
# 91 [
4
# 92 \
5
# 93 ]
4
# 94 ^
5
# 95 _
8
# 96 `
4
# 97 a
7
# 98 b
7
# 99 c
6
# 100 d
7
# 101 e
7
# 102 f
5
# 103 g
7
# 104 h
7
# 105 i
4
# 106 j
5
# 107 k
7
# 108 l
4
# 109 m
10
# 110 n
7
# 111 o
7
# 112 p
7
# 113 q
7
# 114 r
6
# 115 s
6
# 116 t
5
# 117 u
7
# 118 v
7
# 119 w
9
# 120 x
7
# 121 y
7
# 122 z
7
# 123 { -> ñ
7
# 124 | -> ç
7
# 125 }
0
# 126 ~
0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

BIN
media/font/nokia_big2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

@@ -3,7 +3,7 @@
# box height
20
# 32 espacio ( )
14
8
# 33 !
8
# 34 "

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@@ -75,7 +75,7 @@ Temps detes:
## 37 - TEXTOS DEL JUEGO
D E M O
## 38 - TEXTOS DEL JUEGO
PANTALLA
Pantalla
## 39 - MARCADOR
PUNTS
## 40 - MARCADOR
@@ -99,7 +99,7 @@ SI
## 49 - MENU GAME OVER
NO
## 50 - TEXTO DE COMPLETAR EL JUEGO
FELICITATS!!
Felicitats!!
## 51 - MENU DEL TITULO
1 JUGADOR
## 52 - MENU DEL TITULO
@@ -113,7 +113,7 @@ mult
## 56 MARCADOR
max. puntuacio
## 57 MARCADOR
nivell
pantalla
## 58 - MENU DE OPCIONES
MODE DE VISUALITZACIO
## 59 - MENU DE OPCIONES
@@ -148,10 +148,10 @@ NEAREST
ACTIVADA
## 74 - MENU DE OPCIONES
DESACTIVADA
## 75 - MENU DE OPCIONES
ENDAVANT!
## 75 - JUEGO
Endavant!
## 76 - JUEGO
1.000.000 DE PUNTS!
1.000.000 de punts!
## 77 - PANTALLA DE GAME OVER
PUNTS J1:
## 78 - PANTALLA DE GAME OVER

View File

@@ -71,11 +71,11 @@ FUCKING MACHINE!
## 35 - INTRO
Blop... blop... blop...
## 36 - TEXTOS DEL JUEGO
Time Stopped:
Time stopped:
## 37 - TEXTOS DEL JUEGO
D E M O
## 38 - TEXTOS DEL JUEGO
STAGE
Stage
## 39 - MARCADOR
SCORE
## 40 - MARCADOR
@@ -99,7 +99,7 @@ YES
## 49 - MENU GAME OVER
NO
## 50 - TEXTO DE COMPLETAR EL JUEGO
NICE!!
Congratulations!!
## 51 - MENU DEL TITULO
1 PLAYER
## 52 - MENU DEL TITULO
@@ -151,7 +151,7 @@ OFF
## 75 - JUEGO
Get Ready!
## 76 - JUEGO
1.000.000 POINTS!
1.000.000 points!
## 77 - PANTALLA DE GAME OVER
PLAYER1 SCORE:
## 78 - PANTALLA DE GAME OVER

View File

@@ -75,7 +75,7 @@ Tiempo:
## 37 - TEXTOS DEL JUEGO
D E M O
## 38 - TEXTOS DEL JUEGO
FASE
Fase
## 39 - MARCADOR
PUNTOS
## 40 - MARCADOR
@@ -99,7 +99,7 @@ SI
## 49 - MENU GAME OVER
NO
## 50 - TEXTO DE COMPLETAR EL JUEGO
FELICIDADES!!
Felicidades!!
## 51 - MENU DEL TITULO
1 JUGADOR
## 52 - MENU DEL TITULO
@@ -148,10 +148,10 @@ NEAREST
ACTIVADA
## 74 - MENU DE OPCIONES
DESACTIVADA
## 75 - MENU DE OPCIONES
ADELANTE!
## 75 - JUEGO
Adelante!
## 76 - JUEGO
1.000.000 DE PUNTOS!
1.000.000 de puntos!
## 77 - PANTALLA DE GAME OVER
PUNTUACION J1:
## 78 - PANTALLA DE GAME OVER

View File

@@ -48,6 +48,11 @@ Director::Director(std::string path)
// Inicializa JailAudio
initJailAudio();
// Aplica las opciones
SDL_SetWindowFullscreen(mWindow, mOptions->fullScreenMode);
SDL_SetWindowSize(mWindow, SCREEN_WIDTH * mOptions->windowSize, SCREEN_HEIGHT * mOptions->windowSize);
mLang->setLang(mOptions->language);
#ifdef __MIPSEL__
DIR *dir = opendir("/media/data/local/home/.coffee_crisis");
if (dir)
@@ -123,7 +128,7 @@ void Director::init(Uint8 name)
mInput->bindGameControllerButton(INPUT_BUTTON_1, SDL_CONTROLLER_BUTTON_X);
mInput->bindGameControllerButton(INPUT_BUTTON_2, SDL_CONTROLLER_BUTTON_Y);
mInput->bindGameControllerButton(INPUT_BUTTON_3, SDL_CONTROLLER_BUTTON_B);
mInput->bindGameControllerButton(INPUT_BUTTON_PAUSE, SDL_CONTROLLER_BUTTON_GUIDE); // PAUSE
mInput->bindGameControllerButton(INPUT_BUTTON_PAUSE, SDL_CONTROLLER_BUTTON_GUIDE); // PAUSE
mInput->bindGameControllerButton(INPUT_BUTTON_ESCAPE, SDL_CONTROLLER_BUTTON_GUIDE); // ESCAPE
}
@@ -148,6 +153,9 @@ bool Director::initSDL()
}
else
{
// Inicia el generador de numeros aleatorios
std::srand(static_cast<unsigned int>(SDL_GetTicks()));
// Establece el filtro de la textura a nearest
if (!SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, std::to_string(mOptions->filter).c_str()))
{
@@ -257,9 +265,11 @@ void Director::setFileList()
mFileList[27] = mExecutablePath + "/" + "../media/font/8bithud.png";
mFileList[46] = mExecutablePath + "/" + "../media/font/8bithud.txt";
mFileList[28] = mExecutablePath + "/" + "../media/font/nokia.png";
mFileList[54] = mExecutablePath + "/" + "../media/font/nokia_big.png";
mFileList[54] = mExecutablePath + "/" + "../media/font/nokia_big2.png";
mFileList[52] = mExecutablePath + "/" + "../media/font/nokia.txt";
mFileList[55] = mExecutablePath + "/" + "../media/font/nokia_big.txt";
mFileList[56] = mExecutablePath + "/" + "../media/font/nokia2.png";
mFileList[57] = mExecutablePath + "/" + "../media/font/nokia2.txt";
mFileList[55] = mExecutablePath + "/" + "../media/font/nokia_big2.txt";
mFileList[29] = mExecutablePath + "/" + "../media/font/smb2_big.png";
mFileList[47] = mExecutablePath + "/" + "../media/font/smb2_big.txt";
mFileList[30] = mExecutablePath + "/" + "../media/font/smb2.png";
@@ -269,7 +279,7 @@ void Director::setFileList()
mFileList[49] = mExecutablePath + "/" + "../media/lang/es_ES.txt";
mFileList[50] = mExecutablePath + "/" + "../media/lang/en_UK.txt";
mFileList[51] = mExecutablePath + "/" + "../media/lang/ba_BA.txt";
// DATA
mFileList[53] = mExecutablePath + "/" + "../data/gamecontrollerdb.txt";
}
@@ -411,11 +421,6 @@ bool Director::loadConfigFile()
if ((mOptions->language < 0) || (mOptions->language > MAX_LANGUAGES))
mOptions->language = en_UK;
// Aplica las opciones
SDL_SetWindowFullscreen(mWindow, mOptions->fullScreenMode);
SDL_SetWindowSize(mWindow, SCREEN_WIDTH * mOptions->windowSize, SCREEN_HEIGHT * mOptions->windowSize);
mLang->setLang(mOptions->language);
// Cierra el fichero
SDL_RWclose(file);
}

View File

@@ -50,14 +50,14 @@ Game::Game(int numPlayers, SDL_Renderer *renderer, std::string *filelist, Lang *
mTextureText = new LTexture();
mTextureTextScoreBoard = new LTexture();
mTextureTextBig = new LTexture();
mTextureTextNokia = new LTexture();
mTextureTextNokiaBig = new LTexture();
mTextureTextNokia2 = new LTexture();
mTextureTextNokiaBig2 = new LTexture();
mText = new Text(mFileList[48], mTextureText, mRenderer);
mTextScoreBoard = new Text(mFileList[46], mTextureTextScoreBoard, mRenderer);
mTextBig = new Text(mFileList[47], mTextureTextBig, mRenderer);
mTextNokia = new Text(mFileList[52], mTextureTextNokia, mRenderer);
mTextNokiaBig = new Text(mFileList[55], mTextureTextNokiaBig, mRenderer);
mTextNokia2 = new Text(mFileList[57], mTextureTextNokia2, mRenderer);
mTextNokiaBig2 = new Text(mFileList[55], mTextureTextNokiaBig2, mRenderer);
mMenuGameOver = new Menu(mRenderer, mText, mInput, mFileList);
mMenuPause = new Menu(mRenderer, mText, mInput, mFileList);
@@ -194,13 +194,13 @@ Game::~Game()
delete mTextureTextBig;
mTextureTextBig = nullptr;
mTextureTextNokia->unload();
delete mTextureTextNokia;
mTextureTextNokia = nullptr;
mTextureTextNokia2->unload();
delete mTextureTextNokia2;
mTextureTextNokia2 = nullptr;
mTextureTextNokiaBig->unload();
delete mTextureTextNokiaBig;
mTextureTextNokiaBig = nullptr;
mTextureTextNokiaBig2->unload();
delete mTextureTextNokiaBig2;
mTextureTextNokiaBig2 = nullptr;
delete mText;
mText = nullptr;
@@ -211,11 +211,11 @@ Game::~Game()
delete mTextScoreBoard;
mTextScoreBoard = nullptr;
delete mTextNokia;
mTextNokia = nullptr;
delete mTextNokia2;
mTextNokia2 = nullptr;
delete mTextNokiaBig;
mTextNokiaBig = nullptr;
delete mTextNokiaBig2;
mTextNokiaBig2 = nullptr;
delete mMenuGameOver;
mMenuGameOver = nullptr;
@@ -388,6 +388,9 @@ void Game::init()
initEnemyPools();
initGameStages();
// BORRAR
//mStage[mCurrentStage].currentPower = mStage[mCurrentStage].powerToComplete - 10;
// Modo debug
mDebug.enabled = false;
mDebug.enemySet = 0;
@@ -541,8 +544,8 @@ bool Game::loadMedia()
success &= loadTextureFromFile(mTextureText, mFileList[30], mRenderer);
success &= loadTextureFromFile(mTextureTextScoreBoard, mFileList[27], mRenderer);
success &= loadTextureFromFile(mTextureTextBig, mFileList[29], mRenderer);
success &= loadTextureFromFile(mTextureTextNokia, mFileList[28], mRenderer);
success &= loadTextureFromFile(mTextureTextNokiaBig, mFileList[54], mRenderer);
success &= loadTextureFromFile(mTextureTextNokia2, mFileList[56], mRenderer);
success &= loadTextureFromFile(mTextureTextNokiaBig2, mFileList[54], mRenderer);
success &= loadTextureFromFile(mTexturePlayer1Legs, mFileList[39], mRenderer);
success &= loadTextureFromFile(mTexturePlayer1Head, mFileList[41], mRenderer);
@@ -2979,17 +2982,21 @@ void Game::renderMessages()
{
mSpriteGetReady->setPosX((int)mGetReadyBitmapPath[mCounter]);
//mSpriteGetReady->render();
const color_t color = {0x17, 0x17, 0x26};
//const color_t color = {0x17, 0x17, 0x26};
//mTextBig->writeShadowed((int)mGetReadyBitmapPath[mCounter], PLAY_AREA_CENTER_Y - 8, mLang->getText(75), color, 2);
//mTextBig->writeDX(TXT_STROKE, (int)mGetReadyBitmapPath[mCounter], PLAY_AREA_CENTER_Y - 8, mLang->getText(75), 1, noColor, 1, shdwTxtColor);
mTextNokiaBig->write((int)mGetReadyBitmapPath[mCounter], PLAY_AREA_CENTER_Y - 8, mLang->getText(75), -4);
mTextNokiaBig2->write((int)mGetReadyBitmapPath[mCounter], PLAY_AREA_CENTER_Y - 8, mLang->getText(75), -2);
}
// Time Stopped
if (mTimeStopped)
{
if ((mTimeStoppedCounter > 100) || (mTimeStoppedCounter % 10 > 4))
mText->writeDX(TXT_CENTER | TXT_STROKE, PLAY_AREA_CENTER_X, PLAY_AREA_FIRST_QUARTER_Y, mLang->getText(36) + std::to_string(mTimeStoppedCounter / 10), 1, noColor, 1, shdwTxtColor);
mTextNokia2->writeDX(TXT_CENTER, PLAY_AREA_CENTER_X, PLAY_AREA_FIRST_QUARTER_Y, mLang->getText(36) + std::to_string(mTimeStoppedCounter / 10), -1, noColor, 1, shdwTxtColor);
//{
// mTextNokiaBig2->writeDX(TXT_CENTER, PLAY_AREA_CENTER_X, PLAY_AREA_FIRST_QUARTER_Y, mLang->getText(36), -2);
// mTextNokiaBig2->writeDX(TXT_CENTER, PLAY_AREA_CENTER_X, PLAY_AREA_FIRST_QUARTER_Y + mTextNokiaBig2->getCharacterWidth() + 2, std::to_string(mTimeStoppedCounter / 10), -2);
//}
if (mTimeStoppedCounter > 100)
{
@@ -3006,7 +3013,7 @@ void Game::renderMessages()
// D E M O
if (mDemo.enabled)
if (mDemo.counter % 30 > 14)
mTextBig->writeDX(TXT_CENTER | TXT_SHADOW, PLAY_AREA_CENTER_X, PLAY_AREA_FIRST_QUARTER_Y, mLang->getText(37), 0, noColor, 2, shdwTxtColor);
mTextNokiaBig2->writeDX(TXT_CENTER, PLAY_AREA_CENTER_X, PLAY_AREA_FIRST_QUARTER_Y, mLang->getText(37), 0, noColor, 2, shdwTxtColor);
// STAGE NUMBER
if (mStageBitmapCounter < STAGE_COUNTER)
@@ -3014,13 +3021,13 @@ void Game::renderMessages()
std::string text = mLang->getText(38) + std::to_string(mStage[mCurrentStage].number);
if (!mGameCompleted)
{
mTextBig->writeDX(TXT_CENTER | TXT_SHADOW, PLAY_AREA_CENTER_X, mStageBitmapPath[mStageBitmapCounter], text, 1, noColor, 2, shdwTxtColor);
mTextNokiaBig2->writeDX(TXT_CENTER, PLAY_AREA_CENTER_X, mStageBitmapPath[mStageBitmapCounter], text, -2, noColor, 2, shdwTxtColor);
}
else
{ // Texto de juego completado
text = mLang->getText(50);
mTextBig->writeDX(TXT_CENTER | TXT_STROKE, PLAY_AREA_CENTER_X, mStageBitmapPath[mStageBitmapCounter], text, 1, noColor, 1, shdwTxtColor);
mText->writeDX(TXT_CENTER | TXT_STROKE, PLAY_AREA_CENTER_X, mStageBitmapPath[mStageBitmapCounter] + 17, mLang->getText(76), 1, noColor, 1, shdwTxtColor);
mTextNokiaBig2->writeDX(TXT_CENTER, PLAY_AREA_CENTER_X, mStageBitmapPath[mStageBitmapCounter], text, -2, noColor, 1, shdwTxtColor);
mTextNokiaBig2->writeDX(TXT_CENTER, PLAY_AREA_CENTER_X, mStageBitmapPath[mStageBitmapCounter] + mTextNokiaBig2->getCharacterWidth() + 2, mLang->getText(76), -1, noColor, 1, shdwTxtColor);
}
}
}
@@ -3457,7 +3464,7 @@ void Game::initPaths()
}
// Letrero de GetReady
const int size = mTextBig->lenght(mLang->getText(75), -4);
const int size = mTextNokiaBig2->lenght(mLang->getText(75), -2);
const float start1 = PLAY_AREA_LEFT - size;
const float finish1 = PLAY_AREA_CENTER_X - (size / 2);

View File

@@ -108,14 +108,14 @@ private:
LTexture *mTextureText; // Textura para el texto del juego
LTexture *mTextureTextScoreBoard; // Textura para el texto del marcador
LTexture *mTextureTextBig; // Textura para el texto grande
LTexture *mTextureTextNokia; // Textura para la fuente de texto Nokia
LTexture *mTextureTextNokiaBig; // Textura para la fuente de texto Nokia grande
LTexture *mTextureTextNokia2; // Textura para la fuente de texto Nokia
LTexture *mTextureTextNokiaBig2; // Textura para la fuente de texto Nokia grande
Text *mText; // Fuente para los textos del juego
Text *mTextBig; // Fuente de texto grande
Text *mTextScoreBoard; // Fuente para el marcador del juego
Text *mTextNokia; // Otra fuente de texto para mesajes
Text *mTextNokiaBig; // Y la versión en grande
Text *mTextNokia2; // Otra fuente de texto para mesajes
Text *mTextNokiaBig2; // Y la versión en grande
Menu *mMenuGameOver; // Menú de la pantalla de game over
Menu *mMenuPause; // Menú de la pantalla de pausa

View File

@@ -36,13 +36,9 @@ un tipo asociado diferente a NO_KIND
#include "director.h"
#include <stdio.h>
#include <string>
int main(int argc, char *args[])
{
// Inicia el generador de numeros aleatorios
std::srand(static_cast<unsigned int>(SDL_GetTicks()));
printf("Starting the game...\n\n");
// Crea el objeto Director
@@ -54,6 +50,7 @@ int main(int argc, char *args[])
// Destruye el objeto Director
delete mDirector;
mDirector = nullptr;
printf("\nShutting down the game...\n");
return 0;

View File

@@ -1018,7 +1018,7 @@ void Title::checkInputDevices()
temp.name = mInput->getControllerName(i);
temp.deviceType = INPUT_USE_GAMECONTROLLER;
mAvailableInputDevices.push_back(temp);
printf("Device %i:\t%s\n", mAvailableInputDevices.size(), temp.name.c_str());
printf("Device %i:\t%s\n", (int)mAvailableInputDevices.size(), temp.name.c_str());
}
// Añade el teclado al final
@@ -1026,5 +1026,5 @@ void Title::checkInputDevices()
temp.name = "KEYBOARD";
temp.deviceType = INPUT_USE_KEYBOARD;
mAvailableInputDevices.push_back(temp);
printf("Device %i:\t%s\n\n", mAvailableInputDevices.size(), temp.name.c_str());
printf("Device %i:\t%s\n\n", (int)mAvailableInputDevices.size(), temp.name.c_str());
}