diff options
author | nathansmith117 <thenathansmithsmith@gmail.com> | 2024-02-16 17:38:55 +0000 |
---|---|---|
committer | nathansmith117 <thenathansmithsmith@gmail.com> | 2024-02-16 17:38:55 +0000 |
commit | 3631e9c1888d2d2e43e85af654fc0544594795f2 (patch) | |
tree | b74484a01b59971c0c60a96ac637ca3113e50e4c /src/mainMenu.c | |
parent | 2a3b0c6057d913d931d5db361b004c89e78d0385 (diff) | |
download | PenguinYippies-3631e9c1888d2d2e43e85af654fc0544594795f2.tar.gz PenguinYippies-3631e9c1888d2d2e43e85af654fc0544594795f2.tar.bz2 PenguinYippies-3631e9c1888d2d2e43e85af654fc0544594795f2.zip |
Animation play and pause working
Diffstat (limited to 'src/mainMenu.c')
-rw-r--r-- | src/mainMenu.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/mainMenu.c b/src/mainMenu.c index e5d3b60..370b71f 100644 --- a/src/mainMenu.c +++ b/src/mainMenu.c @@ -1,12 +1,11 @@ #include "mainMenu.h" #include "game.h" #include "assets.h" -#include <raylib.h> void initMainMenu(MainMenu* mainMenu, Game* game) { mainMenu->startButtonAnimation = createAnimation( - &game->assets.animations[BUTTON_BOX_ANIMATION], + &game->assets.animations[PENGUIN_LOL_ANIMATION], ANIMATION_DEFAULT_DELAY ); } @@ -15,9 +14,14 @@ void updateMainMenu(MainMenu* mainMenu, Game* game) { ClearBackground(RAYWHITE); - DrawTextureEx(mainMenu->startButtonAnimation.texture, (Vector2){100.0, 100.0}, 0.0, 1.0, WHITE); + DrawTextureEx(mainMenu->startButtonAnimation.texture, (Vector2){100.0, 100.0}, 0.0, 0.1, WHITE); runAnimation(&mainMenu->startButtonAnimation); + if (IsKeyPressed(KEY_SPACE)) + { + toggleAnimation(&mainMenu->startButtonAnimation); + } + DrawFPS(0, 0); } |