Some code tweaks
This commit is contained in:
parent
7fb2459916
commit
1982eabe6e
4 changed files with 177 additions and 193 deletions
|
@ -212,9 +212,6 @@ void InitGameplayScreen(void)
|
|||
int wordInitPosX = 0;
|
||||
int wordInitPosY = 0;
|
||||
|
||||
// TODO: messageWords should be reseted every mission
|
||||
//memcpy(messageWords, 0, sizeof(Word)*MAX_MISSION_WORDS);
|
||||
|
||||
for (int i = 0; i < msgLen; i++)
|
||||
{
|
||||
char c = missions[currentMission].msg[i];
|
||||
|
@ -225,7 +222,6 @@ void InitGameplayScreen(void)
|
|||
messageWords[currentWord - 1].rec.width = (int)MeasureTextEx(fontMessage, SubText(missions[currentMission].msg, wordInitPosX, (i - wordInitPosX)), 30, 0).x;
|
||||
messageWords[currentWord - 1].rec.height = fontMessage.baseSize;
|
||||
|
||||
//TODO: Guardar en message
|
||||
strncpy(messageWords[currentWord - 1].text, SubText(missions[currentMission].msg, wordInitPosX, (i - wordInitPosX)), i - wordInitPosX);
|
||||
}
|
||||
|
||||
|
@ -343,18 +339,11 @@ void UpdateGameplayScreen(void)
|
|||
}
|
||||
}
|
||||
|
||||
// TODO: Move word picked with mouse
|
||||
// Move word picked with mouse
|
||||
if (words[i].picked)
|
||||
{
|
||||
words[i].rec.x = GetMouseX() - words[i].rec.width/2;
|
||||
words[i].rec.y = GetMouseY() - words[i].rec.height/2;
|
||||
|
||||
// TODO: Check if label is placed in some mission word position
|
||||
//if (CheckCollisionRecs(words[i].rec))
|
||||
}
|
||||
else
|
||||
{
|
||||
//if (words[i].id != -1)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ void UpdateLogoScreen(void)
|
|||
fadeValue = 1.0f;
|
||||
framesCounter++;
|
||||
|
||||
if(framesCounter % showLogoFrames == 0)
|
||||
if ((framesCounter%showLogoFrames) == 0)
|
||||
{
|
||||
fadeOut = true;
|
||||
finishScreen = true;
|
||||
|
@ -77,10 +77,7 @@ void UpdateLogoScreen(void)
|
|||
}
|
||||
}
|
||||
|
||||
if(IsKeyPressed(KEY_ENTER))
|
||||
{
|
||||
finishScreen = true;
|
||||
}
|
||||
if (IsKeyPressed(KEY_ENTER)) finishScreen = true;
|
||||
}
|
||||
|
||||
// Logo Screen Draw logic
|
||||
|
|
|
@ -88,8 +88,7 @@ static Music musMission;
|
|||
// Mission Screen Functions Definition
|
||||
//----------------------------------------------------------------------------------
|
||||
static void WriteMissionText();
|
||||
static void EndWritting();
|
||||
static void BlinkKeyword();
|
||||
|
||||
|
||||
// Mission Screen Initialization logic
|
||||
void InitMissionScreen(void)
|
||||
|
@ -167,13 +166,28 @@ void UpdateMissionScreen(void)
|
|||
UpdateMusicStream(musMission);
|
||||
|
||||
if (!writeEnd) WriteMissionText();
|
||||
else BlinkKeyword();
|
||||
else
|
||||
{
|
||||
framesCounter++;
|
||||
|
||||
if ((framesCounter%blinkFrames) == 0)
|
||||
{
|
||||
framesCounter = 0;
|
||||
blinkKeyWord = !blinkKeyWord;
|
||||
}
|
||||
}
|
||||
|
||||
if (showButton)
|
||||
{
|
||||
if (IsKeyPressed(KEY_ENTER) || IsButtonPressed())
|
||||
{
|
||||
if (!writeEnd) EndWritting();
|
||||
if (!writeEnd)
|
||||
{
|
||||
writeEnd = true;
|
||||
writeKeyword = true;
|
||||
writeNumber = true;
|
||||
missionLenght = missionMaxLength;
|
||||
}
|
||||
else
|
||||
{
|
||||
finishScreen = true;
|
||||
|
@ -186,7 +200,7 @@ void UpdateMissionScreen(void)
|
|||
// Mission Screen Draw logic
|
||||
void DrawMissionScreen(void)
|
||||
{
|
||||
// TODO: Draw MISSION screen here!
|
||||
// Draw MISSION screen here!
|
||||
DrawTexture(texBackground, 0,0, WHITE);
|
||||
DrawTexturePro(texBackline, sourceRecBackLine, destRecBackLine, (Vector2){0,0},0, Fade(WHITE, fadeBackLine));
|
||||
|
||||
|
@ -204,7 +218,7 @@ void DrawMissionScreen(void)
|
|||
// Mission Screen Unload logic
|
||||
void UnloadMissionScreen(void)
|
||||
{
|
||||
// TODO: Unload MISSION screen variables here!
|
||||
// Unload MISSION screen variables here!
|
||||
UnloadTexture(texBackground);
|
||||
UnloadTexture(texBackline);
|
||||
UnloadSound(fxTransmit);
|
||||
|
@ -275,19 +289,3 @@ static void WriteMissionText()
|
|||
}
|
||||
}
|
||||
}
|
||||
static void EndWritting()
|
||||
{
|
||||
writeEnd = true;
|
||||
writeKeyword = true;
|
||||
writeNumber = true;
|
||||
missionLenght = missionMaxLength;
|
||||
}
|
||||
static void BlinkKeyword()
|
||||
{
|
||||
framesCounter++;
|
||||
if(framesCounter % blinkFrames == 0)
|
||||
{
|
||||
framesCounter = 0;
|
||||
blinkKeyWord = !blinkKeyWord;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue