aboutsummaryrefslogtreecommitdiffstats
path: root/src/mainMenu.c
blob: 6041e4bbb3d2dacab6b355d96757bc89cdab74d3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "mainMenu.h"
#include "game.h"
#include "assets.h"

void initMainMenu(MainMenu* mainMenu, Game* game)
{
    mainMenu->startButtonAnimation = createAnimation(
        &game->assets.animations[BUTTON_BOX_ANIMATION],
        ANIMATION_DEFAULT_DELAY
    );
}

void updateMainMenu(MainMenu* mainMenu, Game* game)
{
    // Draw background.
    Texture background = game->assets.textures[PENGUIN_BACKGROUND_TEXTURE];

    DrawTexturePro(
        background,
        (Rectangle){0.0, 0.0, background.width, background.height},
        (Rectangle){0.0, 0.0, GetScreenWidth(), GetScreenHeight()},
        (Vector2){0.0, 0.0},
        0.0,
        WHITE
    );
}

void closeMainMenu(MainMenu* mainMenu)
{
    closeAnimation(&mainMenu->startButtonAnimation);
}