aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorraysan5 <raysan5@gmail.com>2013-12-27 12:24:28 +0100
committerraysan5 <raysan5@gmail.com>2013-12-27 12:24:28 +0100
commit62f8f284b992079c470bd0a8e63335e1a8e45e96 (patch)
treef447571b2c26c2c2225c9856272f9e32afa2a9bf /examples
parent989bc0fe9d80107f1f44de647c51963e1dab79fc (diff)
downloadraylib-62f8f284b992079c470bd0a8e63335e1a8e45e96.tar.gz
raylib-62f8f284b992079c470bd0a8e63335e1a8e45e96.zip
Updated example
Diffstat (limited to 'examples')
-rw-r--r--examples/ex06b_logo_anim.c33
-rw-r--r--examples/ex06b_logo_anim.exebin332285 -> 332797 bytes
2 files changed, 30 insertions, 3 deletions
diff --git a/examples/ex06b_logo_anim.c b/examples/ex06b_logo_anim.c
index 02458b33..223801c5 100644
--- a/examples/ex06b_logo_anim.c
+++ b/examples/ex06b_logo_anim.c
@@ -40,7 +40,7 @@ int main()
int state = 0; // Tracking animation states (State Machine)
- float alpha = 1.0;
+ float alpha = 1.0; // Useful for fading
InitWindow(screenWidth, screenHeight, "raylib example 06b - raylib logo animation");
@@ -101,7 +101,30 @@ int main()
{
alpha -= 0.02;
- if (alpha <= 0) alpha = 0;
+ if (alpha <= 0)
+ {
+ alpha = 0;
+ state = 4;
+ }
+ }
+ }
+ else if (state == 4) // State 4: Reset and Replay
+ {
+ if (IsKeyPressed('R'))
+ {
+ framesCounter = 0;
+ lettersCount = 0;
+
+ topSideRecWidth = 16;
+ leftSideRecHeight = 16;
+
+ bottomSideRecWidth = 16;
+ rightSideRecHeight = 16;
+
+ for (int i = 0; i < 8; i++) raylib[i] = ' ';
+ alpha = 1.0;
+
+ state = 0; // Return to State 0
}
}
//----------------------------------------------------------------------------------
@@ -135,7 +158,11 @@ int main()
DrawRectangle(screenWidth/2 - 112, screenHeight/2 - 112, 224, 224, Fade(RAYWHITE, alpha));
DrawText(raylib, 356, 273, 50, Fade(BLACK, alpha));
- }
+ }
+ else if (state == 4)
+ {
+ DrawText("[R] REPLAY", 340, 200, 20, GRAY);
+ }
EndDrawing();
//----------------------------------------------------------------------------------
diff --git a/examples/ex06b_logo_anim.exe b/examples/ex06b_logo_anim.exe
index 8b7ae888..570b2ffc 100644
--- a/examples/ex06b_logo_anim.exe
+++ b/examples/ex06b_logo_anim.exe
Binary files differ