fixing some bugs

This commit is contained in:
2021-08-26 20:49:49 +02:00
parent 3cb822ee6c
commit d240f8123c
13 changed files with 265 additions and 255 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -37,7 +37,7 @@
# 48 0 # 48 0
6 6
# 49 1 # 49 1
3 6
# 50 2 # 50 2
6 6
# 51 3 # 51 3

View File

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

View File

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

@@ -603,7 +603,8 @@ void Balloon::disable()
void Balloon::pop() void Balloon::pop()
{ {
setPopping(true); setPopping(true);
mSprite->setAnimationCounter(0); mSprite->setAnimationCounter(0);
mSprite->disableRotate();
setTimeToLive(120); setTimeToLive(120);
setStop(true); setStop(true);
setStoppedTimer(2000); setStoppedTimer(2000);

View File

@@ -50,7 +50,7 @@ private:
float zoomW; // Zoom aplicado a la anchura float zoomW; // Zoom aplicado a la anchura
float zoomH; // Zoom aplicado a la altura float zoomH; // Zoom aplicado a la altura
float despX; // Desplazamiento de pixeles en el eje X antes de pintar el objeto con zoom float despX; // Desplazamiento de pixeles en el eje X antes de pintar el objeto con zoom
float despY; // idem float despY; // Desplazamiento de pixeles en el eje Y antes de pintar el objeto con zoom
// Vector con los valores de zoom para el ancho y alto del globo // Vector con los valores de zoom para el ancho y alto del globo
float w[MAX_BOUNCE] = {1.10f, 1.05f, 1.00f, 0.95f, 0.90f, 0.95f, 1.00f, 1.02f, 1.05f, 1.02f}; float w[MAX_BOUNCE] = {1.10f, 1.05f, 1.00f, 0.95f, 0.90f, 0.95f, 1.00f, 1.02f, 1.05f, 1.02f};

View File

@@ -171,7 +171,7 @@ Game::~Game()
delete mTextureText; delete mTextureText;
mTextureText = nullptr; mTextureText = nullptr;
mTextureTextScoreBoard->unload(); mTextureTextScoreBoard->unload();
delete mTextureTextScoreBoard; delete mTextureTextScoreBoard;
mTextureTextScoreBoard = nullptr; mTextureTextScoreBoard = nullptr;
@@ -182,7 +182,7 @@ Game::~Game()
delete mText; delete mText;
mText = nullptr; mText = nullptr;
delete mTextScoreBoard; delete mTextScoreBoard;
mTextScoreBoard = nullptr; mTextScoreBoard = nullptr;
delete mTextureTextBig; delete mTextureTextBig;
@@ -401,7 +401,7 @@ void Game::init()
mSpriteScoreBoard->init(0, 160, SCREEN_WIDTH, 32, mTextureGameBG, mRenderer); mSpriteScoreBoard->init(0, 160, SCREEN_WIDTH, 32, mTextureGameBG, mRenderer);
mSpriteScoreBoard->setSpriteClip(0, 160, 256, 32); mSpriteScoreBoard->setSpriteClip(0, 160, 256, 32);
mSpritePowerMeter->init(PLAY_AREA_CENTER_THIRD_QUARTER_X - 20, HISCORE_NUMBER_Y + 4, 40, 8, mTextureGameBG, mRenderer); mSpritePowerMeter->init(PLAY_AREA_CENTER_X - 20, 170, 40, 8, mTextureGameBG, mRenderer);
mSpritePowerMeter->setSpriteClip(256, 192 - 8, 40, 8); mSpritePowerMeter->setSpriteClip(256, 192 - 8, 40, 8);
// Vector de jugadores // Vector de jugadores
@@ -1592,48 +1592,48 @@ void Game::renderScoreBoard()
mSpritePowerMeter->setSpriteClip(296, 184, (int)percent, 8); mSpritePowerMeter->setSpriteClip(296, 184, (int)percent, 8);
mSpritePowerMeter->render(); mSpritePowerMeter->render();
*/ */
const int offset1 = 162; const int offset1 = 163;
const int offset2 = offset1 + 7; const int offset2 = offset1 + 8;
const int offset3 = offset2 + 7; const int offset3 = offset2 + 8;
const int offset4 = offset3 + 7; const int offset4 = offset3 + 8;
// PLAYER1 - SCORE // PLAYER1 - SCORE
mTextScoreBoard->writeCentered(49/2, offset1, mTextStrings[53]); mTextScoreBoard->writeCentered(PLAY_AREA_LEFT + 30, offset1, mTextStrings[53]);
mTextScoreBoard->write(PLAY_AREA_LEFT+1, offset2, updateScoreText(mPlayer[0]->getScore())); mTextScoreBoard->writeCentered(PLAY_AREA_LEFT + 30, offset2, updateScoreText(mPlayer[0]->getScore()));
// PLAYER1 - MULT // PLAYER1 - MULT
mTextScoreBoard->write(PLAY_AREA_LEFT+1, offset3, mTextStrings[55] + std::to_string(mPlayer[0]->getScoreMultiplier()).substr(0, 3)); mTextScoreBoard->writeCentered(PLAY_AREA_LEFT + 30, offset3, mTextStrings[55] + std::to_string(mPlayer[0]->getScoreMultiplier()).substr(0, 3));
if (mNumPlayers == 2) if (mNumPlayers == 2)
{ {
// PLAYER2 - SCORE // PLAYER2 - SCORE
mTextScoreBoard->writeCentered(PLAY_AREA_RIGHT - (49/2), offset1, mTextStrings[54]); mTextScoreBoard->writeCentered(PLAY_AREA_RIGHT - 30, offset1, mTextStrings[54]);
mTextScoreBoard->write(PLAY_AREA_RIGHT - 49, offset2, updateScoreText(mPlayer[1]->getScore())); mTextScoreBoard->writeCentered(PLAY_AREA_RIGHT - 30, offset2, updateScoreText(mPlayer[1]->getScore()));
// PLAYER2 - MULT // PLAYER2 - MULT
mTextScoreBoard->write(PLAY_AREA_RIGHT - (8 * 10), offset3, mTextStrings[55]+std::to_string(mPlayer[1]->getScoreMultiplier()).substr(0, 3)); mTextScoreBoard->writeCentered(PLAY_AREA_RIGHT - 30, offset3, mTextStrings[55] + std::to_string(mPlayer[1]->getScoreMultiplier()).substr(0, 3));
} }
else else
{ {
// PLAYER2 - SCORE // PLAYER2 - SCORE
mTextScoreBoard->writeCentered(PLAY_AREA_RIGHT - (49/2), offset1, mTextStrings[54]); mTextScoreBoard->writeCentered(PLAY_AREA_RIGHT - 30, offset1, mTextStrings[54]);
mTextScoreBoard->write(PLAY_AREA_RIGHT - 49, offset2, "0000000"); mTextScoreBoard->writeCentered(PLAY_AREA_RIGHT - 30, offset2, "0000000");
// PLAYER2 - MULT // PLAYER2 - MULT
mTextScoreBoard->write(PLAY_AREA_RIGHT - (8 * 10), offset3, mTextStrings[55] + "1.0"); mTextScoreBoard->writeCentered(PLAY_AREA_RIGHT - 30, offset3, mTextStrings[55] + "1.0");
} }
// STAGE // STAGE
mTextScoreBoard->writeCentered(PLAY_AREA_CENTER_X, offset1, mTextStrings[57] + std::to_string(mStage[mCurrentStage].number)); mTextScoreBoard->writeCentered(PLAY_AREA_CENTER_X, offset1-1, mTextStrings[57] + std::to_string(mStage[mCurrentStage].number));
// POWER // POWER
//mSpritePowerMeter->setSpriteClip(256, 184, 40, 8); mSpritePowerMeter->setSpriteClip(256, 184, 40, 8);
//mSpritePowerMeter->render(); mSpritePowerMeter->render();
//const float percent = (mStage[mCurrentStage].currentPower * 40.0f) / mStage[mCurrentStage].powerToComplete; const float percent = (mStage[mCurrentStage].currentPower * 40.0f) / mStage[mCurrentStage].powerToComplete;
//mSpritePowerMeter->setSpriteClip(296, 184, (int)percent, 8); mSpritePowerMeter->setSpriteClip(296, 184, (int)percent, 8);
//mSpritePowerMeter->render(); mSpritePowerMeter->render();
// HI-SCORE // HI-SCORE
mTextScoreBoard->writeCentered(PLAY_AREA_CENTER_X, offset4, mTextStrings[56] + "0000000"); mTextScoreBoard->writeCentered(PLAY_AREA_CENTER_X, offset3+1, mTextStrings[56] + updateScoreText(mHiScore));
} }
// Actualiza las variables del jugador // Actualiza las variables del jugador
@@ -2269,10 +2269,10 @@ void Game::resetItems()
// Devuelve un item en función del azar // Devuelve un item en función del azar
Uint8 Game::dropItem() Uint8 Game::dropItem()
{ {
/*if (mPlayer->isPowerUp() || (mCoffeeMachineEnabled)) if (mPlayer[0]->isPowerUp() || (mCoffeeMachineEnabled))
return NO_KIND; return NO_KIND;
else else
return ITEM_COFFEE_MACHINE;*/ return ITEM_COFFEE_MACHINE;
const Uint8 luckyNumber = rand() % 100; const Uint8 luckyNumber = rand() % 100;
const Uint8 item = rand() % 6; const Uint8 item = rand() % 6;

View File

@@ -19,7 +19,7 @@ Instructions::Instructions(SDL_Renderer *renderer, std::string *fileList, std::s
mItemTexture = new LTexture(); mItemTexture = new LTexture();
mTextTexture = new LTexture(); mTextTexture = new LTexture();
mSprite = new Sprite(); mSprite = new Sprite();
mText = new Text(mFileList[46], mTextTexture, mRenderer); mText = new Text(mFileList[48], mTextTexture, mRenderer);
// Crea un backbuffer para el renderizador // Crea un backbuffer para el renderizador
mBackbuffer = SDL_CreateTexture(mRenderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET, SCREEN_WIDTH, SCREEN_HEIGHT); mBackbuffer = SDL_CreateTexture(mRenderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET, SCREEN_WIDTH, SCREEN_HEIGHT);
@@ -156,12 +156,12 @@ void Instructions::run(Uint8 mode)
SDL_RenderClear(mRenderer); SDL_RenderClear(mRenderer);
// Escribe el texto // Escribe el texto
mText->writeDX(TXT_CENTER | TXT_COLOR | TXT_SHADOW, SCREEN_CENTER_X, 8, mTextStrings[11], 0, orangeColor, 1, shdwTxtColor); mText->writeDX(TXT_CENTER | TXT_COLOR | TXT_SHADOW, SCREEN_CENTER_X, 8, mTextStrings[11], 1, orangeColor, 1, shdwTxtColor);
mText->writeDX(TXT_CENTER | TXT_COLOR | TXT_SHADOW, SCREEN_CENTER_X, 24, mTextStrings[12], 0, noColor, 1, shdwTxtColor); mText->writeDX(TXT_CENTER | TXT_COLOR | TXT_SHADOW, SCREEN_CENTER_X, 24, mTextStrings[12], 1, noColor, 1, shdwTxtColor);
mText->writeDX(TXT_CENTER | TXT_COLOR | TXT_SHADOW, SCREEN_CENTER_X, 34, mTextStrings[13], 0, noColor, 1, shdwTxtColor); mText->writeDX(TXT_CENTER | TXT_COLOR | TXT_SHADOW, SCREEN_CENTER_X, 34, mTextStrings[13], 1, noColor, 1, shdwTxtColor);
mText->writeDX(TXT_CENTER | TXT_COLOR | TXT_SHADOW, SCREEN_CENTER_X, 48, mTextStrings[14], 0, noColor, 1, shdwTxtColor); mText->writeDX(TXT_CENTER | TXT_COLOR | TXT_SHADOW, SCREEN_CENTER_X, 48, mTextStrings[14], 1, noColor, 1, shdwTxtColor);
mText->writeDX(TXT_CENTER | TXT_COLOR | TXT_SHADOW, SCREEN_CENTER_X, 58, mTextStrings[15], 0, noColor, 1, shdwTxtColor); mText->writeDX(TXT_CENTER | TXT_COLOR | TXT_SHADOW, SCREEN_CENTER_X, 58, mTextStrings[15], 1, noColor, 1, shdwTxtColor);
mText->writeDX(TXT_CENTER | TXT_COLOR | TXT_SHADOW, SCREEN_CENTER_X, 75, mTextStrings[16], 0, orangeColor, 1, shdwTxtColor); mText->writeDX(TXT_CENTER | TXT_COLOR | TXT_SHADOW, SCREEN_CENTER_X, 75, mTextStrings[16], 1, orangeColor, 1, shdwTxtColor);
mText->writeShadowed(84, 92, mTextStrings[17], shdwTxtColor); mText->writeShadowed(84, 92, mTextStrings[17], shdwTxtColor);
mText->writeShadowed(84, 108, mTextStrings[18], shdwTxtColor); mText->writeShadowed(84, 108, mTextStrings[18], shdwTxtColor);
@@ -170,7 +170,7 @@ void Instructions::run(Uint8 mode)
mText->writeShadowed(84, 156, mTextStrings[21], shdwTxtColor); mText->writeShadowed(84, 156, mTextStrings[21], shdwTxtColor);
if ((mode == INSTRUCTIONS_MODE_MANUAL) && (mCounter % 50 > 14)) if ((mode == INSTRUCTIONS_MODE_MANUAL) && (mCounter % 50 > 14))
mText->writeDX(TXT_CENTER | TXT_COLOR | TXT_SHADOW, SCREEN_CENTER_X, SCREEN_HEIGHT - 12, mTextStrings[22], 0, orangeColor, 1, shdwTxtColor); mText->writeDX(TXT_CENTER | TXT_COLOR | TXT_SHADOW, SCREEN_CENTER_X, SCREEN_HEIGHT - 12, mTextStrings[22], 1, orangeColor, 1, shdwTxtColor);
// Disquito // Disquito
mSprite->init(destRect1, mItemTexture, mRenderer); mSprite->init(destRect1, mItemTexture, mRenderer);

View File

@@ -103,7 +103,7 @@ void Item::init(Uint8 value, float x, float y, LTexture *texture, SDL_Renderer *
} }
} }
// Centra el globo en la posición X // Centra el objeto en la posición X
void Item::allignTo(int x) void Item::allignTo(int x)
{ {
mPosX = float(x - (mWidth / 2)); mPosX = float(x - (mWidth / 2));
@@ -125,7 +125,7 @@ void Item::allignTo(int x)
shiftColliders(); shiftColliders();
} }
// Pinta el globo en la pantalla // Pinta el objeto en la pantalla
void Item::render() void Item::render()
{ {
if (mEnabled) if (mEnabled)
@@ -141,7 +141,7 @@ void Item::render()
} }
} }
// Actualiza la posición y estados del globo // Actualiza la posición y estados del objeto
void Item::move() void Item::move()
{ {
mStatus = 0; mStatus = 0;

View File

@@ -262,6 +262,13 @@ void MovingSprite::setRotateAmount(double value)
mRotateAmount = value; mRotateAmount = value;
} }
// Establece el valor de la variable
void MovingSprite::disableRotate()
{
mRotate = false;
mAngle = 0;
}
// Actualiza las variables internas del objeto // Actualiza las variables internas del objeto
void MovingSprite::update() void MovingSprite::update()
{ {

View File

@@ -127,6 +127,9 @@ public:
// Establece el valor de la variable // Establece el valor de la variable
void setRotateAmount(double value); void setRotateAmount(double value);
// Quita el efecto de rotación y deja el sprite en su angulo inicial.
void disableRotate();
// Cambia el sentido de la rotación // Cambia el sentido de la rotación
void switchRotate(); void switchRotate();
}; };

View File

@@ -26,7 +26,7 @@ Title::Title(SDL_Window *window, SDL_Renderer *renderer, Input *input, std::stri
mDustBitmapL = new AnimatedSprite(); mDustBitmapL = new AnimatedSprite();
mDustBitmapR = new AnimatedSprite(); mDustBitmapR = new AnimatedSprite();
mTile = new Sprite(); mTile = new Sprite();
mText = new Text(mFileList[46], mTextTexture, mRenderer); mText = new Text(mFileList[48], mTextTexture, mRenderer);
mMenu.title = new Menu(mRenderer, mText, mInput, mFileList); mMenu.title = new Menu(mRenderer, mText, mInput, mFileList);
mMenu.options = new Menu(mRenderer, mText, mInput, mFileList); mMenu.options = new Menu(mRenderer, mText, mInput, mFileList);
@@ -531,6 +531,26 @@ section_t Title::run(Uint8 subsection)
} }
} }
// Actualiza el tileado de fondo
switch (mBackgroundMode)
{
case 0: // El tileado de fondo se desplaza en diagonal
mBackgroundWindow.x++;
mBackgroundWindow.x %= 64;
mBackgroundWindow.y++;
mBackgroundWindow.y %= 64;
break;
case 1: // El tileado de fondo se desplaza en circulo
++mBackgroundCounter %= 360;
mBackgroundWindow.x = 128 + (int(mSin[(mBackgroundCounter + 270) % 360] * 128));
mBackgroundWindow.y = 96 + (int(mSin[(360 - mBackgroundCounter) % 360] * 96));
break;
default:
break;
}
// Comprueba las entradas para el menu // Comprueba las entradas para el menu
if (mMenuVisible == true) if (mMenuVisible == true)
mMenu.active->checkInput(); mMenu.active->checkInput();
@@ -616,27 +636,6 @@ section_t Title::run(Uint8 subsection)
// Limpia la pantalla // Limpia la pantalla
SDL_SetRenderDrawColor(mRenderer, bgColor.r, bgColor.g, bgColor.b, 255); SDL_SetRenderDrawColor(mRenderer, bgColor.r, bgColor.g, bgColor.b, 255);
SDL_RenderClear(mRenderer); SDL_RenderClear(mRenderer);
// Pinta el tileado de fondo
switch (mBackgroundMode)
{
case 0: // El tileado de fondo se desplaza en diagonal
mBackgroundWindow.x++;
mBackgroundWindow.x %= 64;
mBackgroundWindow.y++;
mBackgroundWindow.y %= 64;
break;
case 1: // El tileado de fondo se desplaza en circulo
++mBackgroundCounter %= 360;
mBackgroundWindow.x = 128 + (int(mSin[(mBackgroundCounter + 270) % 360] * 128));
mBackgroundWindow.y = 96 + (int(mSin[(360 - mBackgroundCounter) % 360] * 96));
break;
default:
break;
}
SDL_RenderCopy(mRenderer, mBackground, &mBackgroundWindow, NULL); SDL_RenderCopy(mRenderer, mBackground, &mBackgroundWindow, NULL);
// Dibuja los objetos // Dibuja los objetos
@@ -651,10 +650,10 @@ section_t Title::run(Uint8 subsection)
// PRESS ANY KEY! // PRESS ANY KEY!
if ((mCounter % 50 > 14) && (mMenuVisible == false)) if ((mCounter % 50 > 14) && (mMenuVisible == false))
mText->writeDX(TXT_CENTER | TXT_SHADOW, SCREEN_CENTER_X, PLAY_AREA_THIRD_QUARTER_Y + BLOCK, mTextStrings[23], 0, noColor, 1, shdwTxtColor); mText->writeDX(TXT_CENTER | TXT_SHADOW, SCREEN_CENTER_X, PLAY_AREA_THIRD_QUARTER_Y + BLOCK, mTextStrings[23], 1, noColor, 1, shdwTxtColor);
// Texto con el copyright y versión // Texto con el copyright y versión
mText->writeDX(TXT_CENTER | TXT_SHADOW, SCREEN_CENTER_X, SCREEN_HEIGHT - (BLOCK * 2), TEXT_COPYRIGHT, 0, noColor, 1, shdwTxtColor); mText->writeDX(TXT_CENTER | TXT_SHADOW, SCREEN_CENTER_X, SCREEN_HEIGHT - (BLOCK * 2), TEXT_COPYRIGHT, 1, noColor, 1, shdwTxtColor);
// Fade // Fade
mFade->render(); mFade->render();