Ejemplo n.º 1
0
void DrawPlayer(Player p)
{
    for (int i=0; i<MAX_PARTICLES; i++)
    {
        if (p.pEmitter.particles[i].isActive) DrawTextureEx(p.pEmitter.texture, p.pEmitter.particles[i].position, p.pEmitter.particles[i].rotation, 
        p.pEmitter.particles[i].scale, p.pEmitter.particles[i].color);
    }
    DrawTexturePro(p.texture, (Rectangle){0, 0, p.texture.width, p.texture.height}, (Rectangle){p.transform.position.x+p.texture.width/2*ASSETS_SCALE, 
    p.transform.position.y+p.texture.height/2*ASSETS_SCALE, p.texture.width*ASSETS_SCALE, p.texture.height*ASSETS_SCALE}, (Vector2){p.texture.width/2*ASSETS_SCALE, 
    p.texture.height/2*ASSETS_SCALE}, p.transform.rotation, p.color);
}
Ejemplo n.º 2
0
int main()
{
    // Initialization
    //--------------------------------------------------------------------------------------
    int screenWidth = 800;
    int screenHeight = 450;

    InitWindow(screenWidth, screenHeight, "raylib test - texture pro");
    
    // NOTE: Textures MUST be loaded after Window initialization (OpenGL context is required)
    Texture2D texture = LoadTexture("resources/raylib_logo.png");        // Texture loading
    
    Vector2 position = { 200, 100 };
    
    Rectangle sourceRec = { 128, 128, 128, 128 };
    Rectangle destRec = { 128, 128, 128, 128 };
    Vector2 origin = { 64, 64 };    // NOTE: origin is relative to destRec size
    //--------------------------------------------------------------------------------------
    
    // Main game loop
    while (!WindowShouldClose())    // Detect window close button or ESC key
    {
        // Update
        //----------------------------------------------------------------------------------
        // TODO: Update your variables here
        //----------------------------------------------------------------------------------
        
        // Draw
        //----------------------------------------------------------------------------------
        BeginDrawing();
        
            ClearBackground(RAYWHITE);
            
            //DrawTextureEx(texture, position, 45, 1, MAROON);
            
            DrawTexturePro(texture, sourceRec, destRec, origin, 45, GREEN);
            
            DrawLine(destRec.x, 0, destRec.x, screenHeight, RED);
            DrawLine(0, destRec.y, screenWidth, destRec.y, RED);
       
        EndDrawing();
        //----------------------------------------------------------------------------------
    }

    // De-Initialization
    //--------------------------------------------------------------------------------------
    UnloadTexture(texture);       // Texture unloading
    
    CloseWindow();                // Close window and OpenGL context
    //--------------------------------------------------------------------------------------
    
    return 0;
}
Ejemplo n.º 3
0
// Draw text using SpriteFont
// NOTE: chars spacing is NOT proportional to fontSize
void DrawTextEx(SpriteFont spriteFont, const char *text, Vector2 position, float fontSize, int spacing, Color tint)
{
    int length = strlen(text);
    int textOffsetX = 0;        // Offset between characters
    int textOffsetY = 0;        // Required for line break!
    float scaleFactor;
    
    unsigned char letter;       // Current character
    int index;                  // Index position in sprite font
    
    scaleFactor = fontSize/spriteFont.size;

    // NOTE: Some ugly hacks are made to support Latin-1 Extended characters directly
    // written in C code files (codified by default as UTF-8)

    for (int i = 0; i < length; i++)
    {
        if ((unsigned char)text[i] == '\n')
        {
            // NOTE: Fixed line spacing of 1.5 lines
            textOffsetY += ((spriteFont.size + spriteFont.size/2)*scaleFactor);
            textOffsetX = 0;
        }
        else
        {
            if ((unsigned char)text[i] == 0xc2)         // UTF-8 encoding identification HACK!
            {
                // Support UTF-8 encoded values from [0xc2 0x80] -> [0xc2 0xbf](¿)
                letter = (unsigned char)text[i + 1];
                index = GetCharIndex(spriteFont, (int)letter);
                i++;
            }
            else if ((unsigned char)text[i] == 0xc3)    // UTF-8 encoding identification HACK!
            {
                // Support UTF-8 encoded values from [0xc3 0x80](À) -> [0xc3 0xbf](ÿ)
                letter = (unsigned char)text[i + 1];
                index = GetCharIndex(spriteFont, (int)letter + 64);
                i++;
            }
            else index = GetCharIndex(spriteFont, (int)text[i]);

            DrawTexturePro(spriteFont.texture, spriteFont.charRecs[index], 
                           (Rectangle){ position.x + textOffsetX + spriteFont.charOffsets[index].x*scaleFactor,
                                        position.y + textOffsetY + spriteFont.charOffsets[index].y*scaleFactor,
                                        spriteFont.charRecs[index].width*scaleFactor, 
                                        spriteFont.charRecs[index].height*scaleFactor }, (Vector2){ 0, 0 }, 0.0f, tint);

            if (spriteFont.charAdvanceX[index] == 0) textOffsetX += (spriteFont.charRecs[index].width*scaleFactor + spacing);
            else textOffsetX += (spriteFont.charAdvanceX[index]*scaleFactor + spacing);
        }
    }
}
Ejemplo n.º 4
0
// Mission Screen Draw logic
void DrawMissionScreen(void)
{
    // Draw MISSION screen here!
    DrawTexture(texBackground, 0,0, WHITE);
    DrawTexturePro(texBackline, sourceRecBackLine, destRecBackLine, (Vector2){0,0},0, Fade(WHITE, fadeBackLine));

    if (writeNumber) DrawTextEx(fontMission, FormatText("Filtración #%02i ", currentMission + 1), numberPosition, missionSize + 10, 0, numberColor);
    DrawTextEx(fontMission, TextSubtext(missions[currentMission].brief, 0, missionLenght), missionPosition, missionSize, 0, missionColor);
    if (writeKeyword && blinkKeyWord) DrawTextEx(fontMission, FormatText("Keyword: %s", missions[currentMission].key), keywordPosition, missionSize + 10, 0, keywordColor);

    if (showButton)
    {
        if (!writeEnd) DrawButton("saltar");
        else DrawButton("codificar");
    }
}
Ejemplo n.º 5
0
int main(void)
{
    // Initialization
    //--------------------------------------------------------------------------------------
    const int screenWidth = 800;
    const int screenHeight = 450;

    InitWindow(screenWidth, screenHeight, "raylib [textures] example - particles blending");

    // Particles pool, reuse them!
    Particle mouseTail[MAX_PARTICLES] = { 0 };

    // Initialize particles
    for (int i = 0; i < MAX_PARTICLES; i++)
    {
        mouseTail[i].position = (Vector2){ 0, 0 };
        mouseTail[i].color = (Color){ GetRandomValue(0, 255), GetRandomValue(0, 255), GetRandomValue(0, 255), 255 };
        mouseTail[i].alpha = 1.0f;
        mouseTail[i].size = (float)GetRandomValue(1, 30)/20.0f;
        mouseTail[i].rotation = (float)GetRandomValue(0, 360);
        mouseTail[i].active = false;
    }

    float gravity = 3.0f;

    Texture2D smoke = LoadTexture("resources/smoke.png");

    int blending = BLEND_ALPHA;

    SetTargetFPS(60);
    //--------------------------------------------------------------------------------------

    // Main game loop
    while (!WindowShouldClose())    // Detect window close button or ESC key
    {
        // Update
        //----------------------------------------------------------------------------------

        // Activate one particle every frame and Update active particles
        // NOTE: Particles initial position should be mouse position when activated
        // NOTE: Particles fall down with gravity and rotation... and disappear after 2 seconds (alpha = 0)
        // NOTE: When a particle disappears, active = false and it can be reused.
        for (int i = 0; i < MAX_PARTICLES; i++)
        {
            if (!mouseTail[i].active)
            {
                mouseTail[i].active = true;
                mouseTail[i].alpha = 1.0f;
                mouseTail[i].position = GetMousePosition();
                i = MAX_PARTICLES;
            }
        }

        for (int i = 0; i < MAX_PARTICLES; i++)
        {
            if (mouseTail[i].active)
            {
                mouseTail[i].position.y += gravity;
                mouseTail[i].alpha -= 0.01f;

                if (mouseTail[i].alpha <= 0.0f) mouseTail[i].active = false;

                mouseTail[i].rotation += 5.0f;
            }
        }

        if (IsKeyPressed(KEY_SPACE))
        {
            if (blending == BLEND_ALPHA) blending = BLEND_ADDITIVE;
            else blending = BLEND_ALPHA;
        }
        //----------------------------------------------------------------------------------

        // Draw
        //----------------------------------------------------------------------------------
        BeginDrawing();

            ClearBackground(DARKGRAY);

            BeginBlendMode(blending);

                // Draw active particles
                for (int i = 0; i < MAX_PARTICLES; i++)
                {
                    if (mouseTail[i].active) DrawTexturePro(smoke, (Rectangle){ 0.0f, 0.0f, (float)smoke.width, (float)smoke.height },
                                                           (Rectangle){ mouseTail[i].position.x, mouseTail[i].position.y, smoke.width*mouseTail[i].size, smoke.height*mouseTail[i].size },
                                                           (Vector2){ (float)(smoke.width*mouseTail[i].size/2.0f), (float)(smoke.height*mouseTail[i].size/2.0f) }, mouseTail[i].rotation,
                                                           Fade(mouseTail[i].color, mouseTail[i].alpha));
                }

            EndBlendMode();

            DrawText("PRESS SPACE to CHANGE BLENDING MODE", 180, 20, 20, BLACK);

            if (blending == BLEND_ALPHA) DrawText("ALPHA BLENDING", 290, screenHeight - 40, 20, BLACK);
            else DrawText("ADDITIVE BLENDING", 280, screenHeight - 40, 20, RAYWHITE);

        EndDrawing();
        //----------------------------------------------------------------------------------
    }

    // De-Initialization
    //--------------------------------------------------------------------------------------
    UnloadTexture(smoke);

    CloseWindow();        // Close window and OpenGL context
    //--------------------------------------------------------------------------------------

    return 0;
}
Ejemplo n.º 6
0
void UpdateDrawOneFrame(void)
{
    // Update
    //----------------------------------------------------------------------------------
    if (!onTransition)
    {
        switch(currentScreen) 
        {
            case LOADING: 
            {
                // Update LOADING screen variables
                framesCounter++;    // Count frames

                if ((loadBarWidth < loadBarMaxWidth) && ((framesCounter%30) == 0)) loadBarWidth++;

                if (IsKeyDown(KEY_SPACE) && (loadBarWidth < loadBarMaxWidth)) loadBarWidth += 4;

                if (IsKeyPressed(KEY_ENTER) && (loadBarWidth >= loadBarMaxWidth)) TransitionToScreen(LOGO);

            } break;
            case LOGO:
            {
                // Update LOGO screen variables
                if (logoScreenState == 0)                 // State 0: Small box blinking
                {
                    framesCounter++;

                    if (framesCounter == 120)
                    {
                        logoScreenState = 1;
                        framesCounter = 0;      // Reset counter... will be used later...
                    }
                }
                else if (logoScreenState == 1)            // State 1: Top and left bars growing
                {
                    topSideRecWidth += 4;
                    leftSideRecHeight += 4;

                    if (topSideRecWidth == 256) logoScreenState = 2;
                }
                else if (logoScreenState == 2)            // State 2: Bottom and right bars growing
                {
                    bottomSideRecWidth += 4;
                    rightSideRecHeight += 4;

                    if (bottomSideRecWidth == 256)
                    {
                        lettersCounter = 0;
                        for (int i = 0; i < strlen(msgBuffer); i++) msgBuffer[i] = ' ';

                        logoScreenState = 3;
                    }
                }
                else if (logoScreenState == 3)            // State 3: Letters appearing (one by one)
                {
                    framesCounter++;

                    // Every 12 frames, one more letter!
                    if ((framesCounter%12) == 0) raylibLettersCount++;

                    switch (raylibLettersCount)
                    {
                        case 1: raylib[0] = 'r'; break;
                        case 2: raylib[1] = 'a'; break;
                        case 3: raylib[2] = 'y'; break;
                        case 4: raylib[3] = 'l'; break;
                        case 5: raylib[4] = 'i'; break;
                        case 6: raylib[5] = 'b'; break;
                        default: break;
                    }

                    if (raylibLettersCount >= 10)
                    {
                        // Write raylib description messages
                        if ((framesCounter%2) == 0) lettersCounter++;

                        if (!msgLogoADone)
                        {
                            if (lettersCounter <= strlen(msgLogoA)) strncpy(msgBuffer, msgLogoA, lettersCounter);
                            else
                            {
                                for (int i = 0; i < strlen(msgBuffer); i++) msgBuffer[i] = ' ';

                                lettersCounter = 0;
                                msgLogoADone = true;
                            }
                        }
                        else if (!msgLogoBDone)
                        {
                            if (lettersCounter <= strlen(msgLogoB)) strncpy(msgBuffer, msgLogoB, lettersCounter);
                            else
                            {
                                msgLogoBDone = true;
                                framesCounter = 0;
                            }
                        }
                    }
                }

                // Press enter to change to MODULES screen
                if (IsKeyPressed(KEY_ENTER) && msgLogoBDone) TransitionToScreen(MODULES);
                else if (IsKeyPressed(KEY_BACKSPACE)) TransitionToScreen(LOGO);

            } break;
            case MODULES:
            {
                // Update MODULES screen variables here!
                framesCounter++;

                if (IsKeyPressed(KEY_RIGHT) && (selectedModule < 5))
                {
                    selectedModule++;
                    framesCounter = 0;
                }
                else if (IsKeyPressed(KEY_LEFT) && (selectedModule > 0))
                {
                    selectedModule--;
                    framesCounter = 0;
                }

                if (selectedModule == CORE)
                {
                    if ((framesCounter > 60) && (windowOffset < 40))
                    {
                        windowOffset++;
                        ballPosition.x++;
                        ballPosition.y++;
                    }

                    if (framesCounter > 140)
                    {
                        if (IsKeyDown('A')) ballPosition.x -= 5;
                        if (IsKeyDown('D')) ballPosition.x += 5;
                        if (IsKeyDown('W')) ballPosition.y -= 5;
                        if (IsKeyDown('S')) ballPosition.y += 5;

                        if (IsKeyPressed('1')) coreWindow = 1;
                        if (IsKeyPressed('2')) coreWindow = 2;
                        if (IsKeyPressed('3')) coreWindow = 3;
                        if (IsKeyPressed('4')) coreWindow = 4;
                    }
                }

                if (selectedModule == TEXTURES) scaleFactor = (sinf(2*PI/240*framesCounter) + 1.0f)/2;

                if (selectedModule == AUDIO)
                {
                    if (IsKeyPressed(KEY_SPACE) && !MusicIsPlaying()) PlayMusicStream("resources/audio/guitar_noodling.ogg");         // Play music stream

                    if (IsKeyPressed('S'))
                    {
                        StopMusicStream();
                        timePlayed = 0.0f;

                        for (int i = 0; i < MAX_BALLS; i++)
                        {
                            soundBallsPosition[i] = (Vector2){ 650 + 560/2 + GetRandomValue(-280, 280), 220 + 200 + GetRandomValue(-200, 200) };
                            soundBallsColor[i] = (Color){ GetRandomValue(0, 255), GetRandomValue(0, 255), GetRandomValue(0, 255), 255 };
                            soundBallsRadius[i] = GetRandomValue(2, 50);
                            soundBallsAlpha[i] = 1.0f;

                            soundBallsActive[i] = false;
                        }
                    }

                    if (MusicIsPlaying())
                    {
                        timePlayed = GetMusicTimePlayed() / GetMusicTimeLength() * 100 * 4;

                        if ((framesCounter%10) == 0)
                        {
                            for (int i = 0; i < MAX_BALLS; i++)
                            {
                                if (!soundBallsActive[i])
                                {
                                    soundBallsActive[i] = true;
                                    break;
                                }
                            }
                        }

                        for (int i = 0; i < MAX_BALLS; i++)
                        {
                            if (soundBallsActive[i]) soundBallsAlpha[i] -= 0.005f;

                            if (soundBallsAlpha[i] <= 0)
                            {
                                soundBallsActive[i] = false;

                                // Reset ball random
                                soundBallsPosition[i] = (Vector2){ 650 + 560/2 + GetRandomValue(-280, 280), 220 + 200 + GetRandomValue(-200, 200) };
                                soundBallsColor[i] = (Color){ GetRandomValue(0, 255), GetRandomValue(0, 255), GetRandomValue(0, 255), 255 };
                                soundBallsRadius[i] = GetRandomValue(2, 60);
                                soundBallsAlpha[i] = 1.0f;
                            }
                        }
                    }

                    if (IsKeyPressed('N')) PlaySound(fxWav);
                    //if (IsKeyPressed('M')) PlaySound(fxOgg);
                }

                // Press enter to change to ENDING screen
                if (IsKeyPressed(KEY_ENTER)) TransitionToScreen(ENDING);
                else if (IsKeyPressed(KEY_BACKSPACE)) TransitionToScreen(LOGO);

            } break;
            case PONG:
            {
                // Update SECRET screen variables here!
                framesCounter++;

                if (IsKeyPressed('P')) pongPaused = !pongPaused;
                
                if (!pongPaused)
                {
                    pongBallPosition.x += pongBallSpeed.x;
                    pongBallPosition.y += pongBallSpeed.y;

                    if ((pongBallPosition.x >= screenWidth - 5) || (pongBallPosition.x <= 5)) pongBallSpeed.x *= -1;
                    if ((pongBallPosition.y >= screenHeight - 5) || (pongBallPosition.y <= 5)) pongBallSpeed.y *= -1;

                    if (IsKeyDown(KEY_UP) || IsKeyDown('W'))
                    {
                        pongPlayerRec.y -= 5;
                        pongAutoMode = false;
                        pongAutoCounter = 180;
                    }
                    else if (IsKeyDown(KEY_DOWN) || IsKeyDown('S'))
                    {
                        pongPlayerRec.y += 5;
                        pongAutoMode = false;
                        pongAutoCounter = 180;
                    }
                    else if (pongAutoCounter > 0)
                    {
                        pongAutoCounter--;
                        
                        if (pongAutoCounter == 0) pongAutoMode = true;
                    }

                    if ((pongBallPosition.x < 600) && pongAutoMode)
                    {
                        if (pongBallPosition.y > (pongPlayerRec.y + pongPlayerRec.height/2)) pongPlayerRec.y += 5;
                        else if (pongBallPosition.y < (pongPlayerRec.y + pongPlayerRec.height/2)) pongPlayerRec.y -= 5;
                    }

                    if (pongPlayerRec.y <= 0) pongPlayerRec.y = 0;
                    else if ((pongPlayerRec.y + pongPlayerRec.height) >= screenHeight) pongPlayerRec.y = screenHeight - pongPlayerRec.height;
                    
                    if (pongBallPosition.x > screenWidth - 600)
                    {
                        if (pongBallPosition.y > (pongEnemyRec.y + pongEnemyRec.height/2)) pongEnemyRec.y += 5;
                        else if (pongBallPosition.y < (pongEnemyRec.y + pongEnemyRec.height/2)) pongEnemyRec.y -= 5;

                        if (pongEnemyRec.y <= 0) pongEnemyRec.y = 0;
                        else if ((pongEnemyRec.y + pongEnemyRec.height) >= screenHeight) pongEnemyRec.y = screenHeight - pongEnemyRec.height;
                    }

                    if ((CheckCollisionCircleRec(pongBallPosition, 10, pongPlayerRec)) || (CheckCollisionCircleRec(pongBallPosition, 10, pongEnemyRec))) pongBallSpeed.x *= -1;
                    
                    if (pongBallPosition.x >= screenWidth - 5) pongScorePlayer++;
                    else if (pongBallPosition.x <= 5) pongScoreEnemy++;
                }

                // Press enter to move back to MODULES screen
                if (IsKeyPressed(KEY_ENTER)) TransitionToScreen(ENDING);
                if (IsKeyPressed(KEY_BACKSPACE)) TransitionToScreen(ENDING);
            } break;
            case ENDING:
            {
                // Update ENDING screen
                framesCounter++;

                // Press enter to move back to MODULES screen
                if (IsKeyPressed(KEY_ENTER)) TransitionToScreen(PONG);
                if (IsKeyPressed(KEY_BACKSPACE)) TransitionToScreen(MODULES);

            } break;
            default: break;
        }

        if ((currentScreen != LOADING) && (timeCounter < totalTime)) timeCounter++;
    }
    else UpdateTransition(); // Update transition (fade-in, fade-out)
    //----------------------------------------------------------------------------------

    // Draw
    //----------------------------------------------------------------------------------
    BeginDrawing();

        ClearBackground(RAYWHITE);

        switch(currentScreen)
        {
            case LOADING:
            {
                // Draw LOADING screen
                if ((loadBarWidth < loadBarMaxWidth) && ((framesCounter/40)%2)) DrawText(msgLoading, 360, 240, 40, DARKGRAY);

                DrawRectangle(360 - 4, 300 - 4, loadBarMaxWidth + 8, 60 + 8, LIGHTGRAY);
                DrawRectangle(360, 300, loadBarWidth - 1, 60, DARKGRAY);
                DrawRectangleLines(360 - 4, 300 - 5, loadBarMaxWidth + 8, 60 + 8, DARKGRAY);

                if (loadBarWidth >= loadBarMaxWidth)
                {
                    //DrawText(msgLoading, 360, 240, 40, DARKGRAY);
                    if ((framesCounter/30)%2) DrawText(msgPressEnter, screenWidth/2 - MeasureText(msgPressEnter, 40)/2 + 20, 400, 40, DARKGRAY);
                }
                else DrawText("PRESS SPACE to ACCELERATE LOADING! ;)", screenWidth/2 - 200, 400, 20, LIGHTGRAY);

            } break;
            case LOGO:
            {
                // Draw LOGO screen
                if (logoScreenState == 0)
                {
                    if ((framesCounter/15)%2) DrawRectangle(logoPositionX, logoPositionY - 60, 16, 16, BLACK);
                }
                else if (logoScreenState == 1)
                {
                    DrawRectangle(logoPositionX, logoPositionY - 60, topSideRecWidth, 16, BLACK);
                    DrawRectangle(logoPositionX, logoPositionY - 60, 16, leftSideRecHeight, BLACK);
                }
                else if (logoScreenState == 2)
                {
                    DrawRectangle(logoPositionX, logoPositionY - 60, topSideRecWidth, 16, BLACK);
                    DrawRectangle(logoPositionX, logoPositionY - 60, 16, leftSideRecHeight, BLACK);

                    DrawRectangle(logoPositionX + 240, logoPositionY - 60, 16, rightSideRecHeight, BLACK);
                    DrawRectangle(logoPositionX, logoPositionY + 240 - 60, bottomSideRecWidth, 16, BLACK);
                }
                else if (logoScreenState == 3)
                {
                    DrawRectangle(logoPositionX, logoPositionY - 60, topSideRecWidth, 16, BLACK);
                    DrawRectangle(logoPositionX, logoPositionY + 16 - 60, 16, leftSideRecHeight - 32, BLACK);

                    DrawRectangle(logoPositionX + 240, logoPositionY + 16 - 60, 16, rightSideRecHeight - 32, BLACK);
                    DrawRectangle(logoPositionX, logoPositionY + 240 - 60, bottomSideRecWidth, 16, BLACK);

                    DrawRectangle(screenWidth/2 - 112, screenHeight/2 - 112 - 60, 224, 224, RAYWHITE);

                    DrawText(raylib, screenWidth/2 - 44, screenHeight/2 + 48 - 60, 50, BLACK);

                    if (!msgLogoADone) DrawText(msgBuffer, screenWidth/2 - MeasureText(msgLogoA, 30)/2, 460, 30, GRAY);
                    else
                    {
                        DrawText(msgLogoA, screenWidth/2 - MeasureText(msgLogoA, 30)/2, 460, 30, GRAY);

                        if (!msgLogoBDone) DrawText(msgBuffer, screenWidth/2 - MeasureText(msgLogoB, 30)/2, 510, 30, GRAY);
                        else
                        {
                            DrawText(msgLogoB, screenWidth/2 - MeasureText(msgLogoA, 30)/2, 510, 30, GRAY);

                            if ((framesCounter > 90) && ((framesCounter/30)%2)) DrawText("PRESS ENTER to CONTINUE", 930, 650, 20, GRAY);
                        }
                    }
                }
            } break;
            case MODULES:
            {
                // Draw MODULES screen
                DrawTexture(raylibLogoB, 40, 40, WHITE);
                DrawText("raylib is composed of 6 main modules:", 128 + 40 + 30, 50, 20, GRAY);

                if (framesCounter < 120)
                {
                    if (((framesCounter/30)%2) == 0) DrawRectangle(128 + 40 + 30 - 4 + 175*selectedModule, 128 + 40 - 70 - 8 - 4, 158, 78, RED);
                }
                else DrawRectangle(128 + 40 + 30 - 4 + 175*selectedModule, 128 + 40 - 70 - 8 - 4, 158, 78, RED);
                
                if (selectedModule != AUDIO)
                {
                    DrawTriangle((Vector2){950 - 40, 685 - 10}, (Vector2){950 - 60, 685}, (Vector2){950 - 40, 685 + 10}, GRAY);
                    DrawTriangle((Vector2){950 - 30, 685 - 10}, (Vector2){950 - 30, 685 + 10}, (Vector2){950 - 10, 685}, GRAY);
                    DrawText("PRESS RIGHT or LEFT to EXPLORE MODULES", 960, 680, 10, GRAY);
                }

                switch (selectedModule)
                {
                    case CORE:
                    {
                        DrawText("This module give you functions to:", 48, 200, 10, GetColor(0x5c5a5aff));
                    
                        DrawTextEx(fontRomulus, "Open-Close Window", (Vector2){ 48, 230 }, GetFontBaseSize(fontRomulus)*2, 4, GetColor(0x5c5a5aff));
                        DrawTextEx(fontRomulus, "Manage Drawing Area", (Vector2){ 48, 260 }, GetFontBaseSize(fontRomulus)*2, 4, GetColor(0x5c5a5aff));
                        DrawTextEx(fontRomulus, "Manage Inputs", (Vector2){ 48, 290 }, GetFontBaseSize(fontRomulus)*2, 4, GetColor(0x5c5a5aff));
                        DrawTextEx(fontRomulus, "Manage Timming", (Vector2){ 48, 320 }, GetFontBaseSize(fontRomulus)*2, 4, GetColor(0x5c5a5aff));
                        DrawTextEx(fontRomulus, "Auxiliar Functions", (Vector2){ 48, 350 }, GetFontBaseSize(fontRomulus)*2, 4, GetColor(0x5c5a5aff));

                        switch (coreWindow)
                        {
                            case 1: DrawTexture(raylibWindow, 520, 220, WHITE); break;
                            case 2: DrawTextureEx(raylibWindow01, (Vector2){ 450, 220 - 45 }, 0.0f, 4.0f, WHITE); break;
                            case 3: DrawTextureEx(raylibWindow02, (Vector2){ 430, 220 - 40 }, 0.0f, 4.0f, WHITE); break;
                            case 4: DrawTextureEx(raylibWindow03, (Vector2){ 470, 220 - 65 }, 0.0f, 4.0f, WHITE); break;
                            default: DrawTexture(raylibWindow, 520, 220, WHITE); break;
                        }
                        
                        if (framesCounter > 140) DrawText("Check the possible windows raylib can run on. PRESS KEY: 1, 2, 3 or 4", 520 + 8 + windowOffset + 160, 220 + windowOffset + 10, 10, LIGHTGRAY);                        
                        
                        DrawText("Compile raylib C code for the folowing platforms:", 48, 400, 10, MAROON);
                        
                        DrawTextureRec(platforms, (Rectangle){ 0, 0, platforms.width, platforms.height}, (Vector2){ 75, 420 }, WHITE);

                        DrawRectangle(520 + 8 + windowOffset, 220 + 31 + windowOffset, 640, 360, RAYWHITE);
                        DrawRectangleLines(520 + 8 + windowOffset - 1, 220 + 31 + windowOffset - 2, 640 + 2, 360 + 2, GRAY);
                        DrawFPS(520 + 8 + windowOffset + 10, 220 + 31 + windowOffset + 10);
                        
                        DrawRectangle(ballPosition.x - 50, ballPosition.y - 50, 100, 100, Fade(MAROON, 0.5f));
                        DrawRectangleRec(GetCollisionRec((Rectangle){ 520 + 8 + windowOffset - 1, 220 + 31 + windowOffset - 1, 640 + 2, 360 + 2 }, (Rectangle){ (int)ballPosition.x - 50, (int)ballPosition.y - 50, 100, 100 }), MAROON);
                        
                        if (framesCounter > 140)
                        {
                            DrawTextEx(fontMecha, "MOVE ME", (Vector2){ ballPosition.x - 26, ballPosition.y - 20 }, GetFontBaseSize(fontMecha), 2, BLACK);
                            DrawTextEx(fontMecha, "[ W A S D ]", (Vector2){ ballPosition.x - 36, ballPosition.y }, GetFontBaseSize(fontMecha), 2, BLACK);
                        }
                    } break;
                    case SHAPES:
                    {
                        DrawText("This module give you functions to:", 48, 200, 10, GetColor(0xcd5757ff));
                    
                        DrawTextEx(fontRomulus, "Draw Basic Shapes", (Vector2){ 48, 230 }, GetFontBaseSize(fontRomulus)*2, 4, GetColor(0xcd5757ff));
                        DrawTextEx(fontRomulus, "Basic Collision Detection", (Vector2){ 48, 260 }, GetFontBaseSize(fontRomulus)*2, 4, GetColor(0xcd5757ff));

                        DrawCircle(screenWidth/4, 120 + 240, 35, DARKBLUE);
                        DrawCircleGradient(screenWidth/4, 220 + 240, 60, GREEN, SKYBLUE);
                        DrawCircleLines(screenWidth/4, 340 + 240, 80, DARKBLUE);

                        DrawRectangle(screenWidth/4*2 - 110, 100 + 180, 220, 100, LIME);
                        DrawRectangleGradient(screenWidth/4*2 - 90, 170 + 240, 180, 130, MAROON, GOLD);
                        DrawRectangleLines(screenWidth/4*2 - 80, 320 + 240, 160, 80, ORANGE);

                        DrawTriangle((Vector2){screenWidth/4*3, 60 + 220}, (Vector2){screenWidth/4*3 - 60, 160 + 220}, (Vector2){screenWidth/4*3 + 60, 160 + 220}, VIOLET);

                        DrawTriangleLines((Vector2){screenWidth/4*3, 140 + 220}, (Vector2){screenWidth/4*3 - 60, 210 + 260}, (Vector2){screenWidth/4*3 + 60, 210 + 260}, SKYBLUE);

                        DrawPoly((Vector2){screenWidth/4*3, 320 + 240}, 6, 80, 0, BROWN);

                    } break;
                    case TEXTURES:
                    {
                        DrawText("This module give you functions to:", 48, 200, 10, GetColor(0x60815aff));
                    
                        DrawTextEx(fontRomulus, "Load Images and Textures", (Vector2){ 48, 230 }, GetFontBaseSize(fontRomulus)*2, 4, GetColor(0x60815aff));
                        DrawTextEx(fontRomulus, "Draw Textures", (Vector2){ 48, 260 }, GetFontBaseSize(fontRomulus)*2, 4, GetColor(0x60815aff));

                        DrawRectangle(138, 348, 260, 260, GRAY);
                        DrawTexturePro(lena, (Rectangle){ 0, 0, lena.width, lena.height }, (Rectangle){ 140 + 128, 350 + 128, lena.width/2*scaleFactor, lena.height/2*scaleFactor }, (Vector2){ lena.width/4*scaleFactor, lena.height/4*scaleFactor }, 0.0f, WHITE);

                        DrawTexture(lena, 600, 180, Fade(WHITE, 0.3f));
                        DrawTextureRec(lena, (Rectangle){ 225, 240, 155, 50 }, (Vector2){ 600 + 256 - 82 + 50, 180 + 241 }, PINK);

                        DrawTexturePro(mandrill, (Rectangle){ 0, 0, mandrill.width, mandrill.height }, (Rectangle){ screenWidth/2 - 40, 350 + 128, mandrill.width/2, mandrill.height/2 },
                                        (Vector2){ mandrill.width/4, mandrill.height/4 }, framesCounter, GOLD);

                    } break;
                    case TEXT:
                    {
                        DrawText("This module give you functions to:", 48, 200, 10, GetColor(0x377764ff));
                    
                        DrawTextEx(fontRomulus, "Load SpriteFonts", (Vector2){ 48, 230 }, GetFontBaseSize(fontRomulus)*2, 4, GetColor(0x377764ff));
                        DrawTextEx(fontRomulus, "Draw Text", (Vector2){ 48, 260 }, GetFontBaseSize(fontRomulus)*2, 4, GetColor(0x377764ff));
                        DrawTextEx(fontRomulus, "Text Formatting", (Vector2){ 48, 290 }, GetFontBaseSize(fontRomulus)*2, 4, GetColor(0x377764ff));

                        DrawTexture(texAlagard, 60, 360, WHITE);

                        DrawTextEx(fontMechaC, msg1, (Vector2){ 540 + 168, 210 }, GetFontBaseSize(fontMechaC), -3, WHITE);
                        DrawTextEx(fontAlagardC, msg2, (Vector2){ 460 + 140, 260 }, GetFontBaseSize(fontAlagardC), -2, WHITE);
                        DrawTextEx(fontJupiterC, msg3, (Vector2){ 640 + 70, 300 }, GetFontBaseSize(fontJupiterC), 2, WHITE);

                        DrawTextEx(fontAlagard, "It also includes some...", (Vector2){ 650 + 70, 400 }, GetFontBaseSize(fontAlagard)*2, 2, MAROON);
                        DrawTextEx(fontPixelplay, "...free fonts in rBMF format...", (Vector2){ 705 - 26, 450 }, GetFontBaseSize(fontPixelplay)*2, 4, ORANGE);
                        DrawTextEx(fontMecha, "...to be used even in...", (Vector2){ 700 + 40, 500 }, GetFontBaseSize(fontMecha)*2, 4, DARKGREEN);
                        DrawTextEx(fontSetback, "...comercial projects...", (Vector2){ 710, 550 }, GetFontBaseSize(fontSetback)*2, 4, DARKBLUE);
                        DrawTextEx(fontRomulus, "...completely for free!", (Vector2){ 710 + 17, 600 }, GetFontBaseSize(fontRomulus)*2, 3, DARKPURPLE);
                        
                        DrawText("This is a custom font spritesheet, raylib can load it automatically!", 228, 360 + 295, 10, GRAY);

                    } break;
                    case MODELS:
                    {
                        DrawText("This module give you functions to:", 48, 200, 10, GetColor(0x417794ff));
                        
                        DrawTextEx(fontRomulus, "Draw Geometric Models", (Vector2){ 48, 230 }, GetFontBaseSize(fontRomulus)*2, 4, GetColor(0x417794ff));
                        DrawTextEx(fontRomulus, "Load 3D Models", (Vector2){ 48, 260 }, GetFontBaseSize(fontRomulus)*2, 4, GetColor(0x417794ff));
                        DrawTextEx(fontRomulus, "Draw 3D Models", (Vector2){ 48, 290 }, GetFontBaseSize(fontRomulus)*2, 4, GetColor(0x417794ff));

                        Begin3dMode(camera);

                            DrawCube((Vector3){-4, 0, 2}, 2, 5, 2, RED);
                            DrawCubeWires((Vector3){-4, 0, 2}, 2, 5, 2, GOLD);
                            DrawCubeWires((Vector3){-4, 0, -2}, 3, 6, 2, MAROON);

                            DrawSphere((Vector3){-1, 0, -2}, 1, GREEN);
                            DrawSphereWires((Vector3){1, 0, 2}, 2, 16, 16, LIME);

                            DrawCylinder((Vector3){4, 0, -2}, 1, 2, 3, 4, SKYBLUE);
                            DrawCylinderWires((Vector3){4, 0, -2}, 1, 2, 3, 4, DARKBLUE);
                            DrawCylinderWires((Vector3){4.5, -1, 2}, 1, 1, 2, 6, BROWN);

                            DrawCylinder((Vector3){1, 0, -4}, 0, 1.5, 3, 8, GOLD);
                            DrawCylinderWires((Vector3){1, 0, -4}, 0, 1.5, 3, 8, PINK);

                            DrawModelEx(cat, (Vector3){ 8.0f, 0.0f, 2.0f }, (Vector3){ 0.0f, 0.5f*framesCounter, 0.0f }, (Vector3){ 0.1f, 0.1f, 0.1f }, WHITE);
                            DrawGizmo((Vector3){ 8.0f, 0.0f, 2.0f });

                            DrawGrid(10.0, 1.0);        // Draw a grid

                        End3dMode();

                        DrawFPS(900, 220);

                    } break;
                    case AUDIO:
                    {
                        DrawText("This module give you functions to:", 48, 200, 10, GetColor(0x8c7539ff));
                        
                        DrawTextEx(fontRomulus, "Load and Play Sounds", (Vector2){ 48, 230 }, GetFontBaseSize(fontRomulus)*2, 4, GetColor(0x8c7539ff));
                        DrawTextEx(fontRomulus, "Play Music (streaming)", (Vector2){ 48, 260 }, GetFontBaseSize(fontRomulus)*2, 4, GetColor(0x8c7539ff));

                        DrawText("PRESS SPACE to START PLAYING MUSIC", 135, 350, 20, GRAY);
                        DrawRectangle(150, 390, 400, 12, LIGHTGRAY);
                        DrawRectangle(150, 390, (int)timePlayed, 12, MAROON);

                        if (MusicIsPlaying())
                        {
                            DrawText("PRESS 'S' to STOP PLAYING MUSIC", 165, 425, 20, GRAY);

                            for (int i = 0; i < MAX_BALLS; i++)
                            {
                                if (soundBallsActive[i]) DrawPoly(soundBallsPosition[i], 18, soundBallsRadius[i], 0.0f, Fade(soundBallsColor[i], soundBallsAlpha[i]));
                            }
                        }

                        DrawText("PRESS 'N' to PLAY a SOUND", 200, 540, 20, VIOLET);

                        if ((framesCounter/30)%2) DrawText("PRESS ENTER to CONTINUE", 930, 650, 20, GRAY);

                    } break;
                    default: break;
                }

                // Draw modules menu
                DrawRectangle(128 + 40 + 30, 128 + 40 - 70 - 8, 150, 70, GetColor(0x898888ff));
                DrawRectangle(128 + 40 + 30 + 8, 128 + 40 - 70, 150 - 16, 70 - 16, GetColor(0xe1e1e1ff));
                DrawText("CORE", 128 + 40 + 30 + 8 + 38, 128 + 40 - 50, 20, GetColor(0x5c5a5aff));

                DrawRectangle(128 + 40 + 30 + 175, 128 + 40 - 70 - 8, 150, 70, GetColor(0xe66666ff));
                DrawRectangle(128 + 40 + 30 + 8 + 175, 128 + 40 - 70, 150 - 16, 70 - 16, GetColor(0xf0d6d6ff));
                DrawText("SHAPES", 128 + 40 + 30 + 8 + 175 + 28, 128 + 40 - 50, 20, GetColor(0xcd5757ff));

                DrawRectangle(128 + 40 + 30 + 175*2, 128 + 40 - 70 - 8, 150, 70, GetColor(0x75a06dff));
                DrawRectangle(128 + 40 + 30 + 8 + 175*2, 128 + 40 - 70, 150 - 16, 70 - 16, GetColor(0xc8eabfff));
                DrawText("TEXTURES", 128 + 40 + 30 + 175*2 + 8 + 9, 128 + 40 - 50, 20, GetColor(0x60815aff));

                DrawRectangle(128 + 40 + 30 + 175*3, 128 + 40 - 70 - 8, 150, 70, GetColor(0x52b296ff));
                DrawRectangle(128 + 40 + 30 + 8 + 175*3, 128 + 40 - 70, 150 - 16, 70 - 16, GetColor(0xbef0ddff));
                DrawText("TEXT", 128 + 40 + 30 + 8 + 175*3 + 38, 128 + 40 - 50, 20, GetColor(0x377764ff));

                DrawRectangle(128 + 40 + 30 + 175*4, 128 + 40 - 70 - 8, 150, 70, GetColor(0x5d9cbdff));
                DrawRectangle(128 + 40 + 30 + 8 + 175*4, 128 + 40 - 70, 150 - 16, 70 - 16, GetColor(0xbedce8ff));
                DrawText("MODELS", 128 + 40 + 30 + 8 + 175*4 + 28, 128 + 40 - 50, 20, GetColor(0x417794ff));

                DrawRectangle(128 + 40 + 30 + 175*5, 128 + 40 - 70 - 8, 150, 70, GetColor(0xd3b157ff));
                DrawRectangle(128 + 40 + 30 + 8 + 175*5, 128 + 40 - 70, 150 - 16, 70 - 16, GetColor(0xebddaeff));
                DrawText("AUDIO", 128 + 40 + 30 + 8 + 175*5 + 36, 128 + 40 - 50, 20, GetColor(0x8c7539ff));

            } break;
            case ENDING:
            {
                // Draw ENDING screen
                DrawTextEx(fontAlagard, "LEARN VIDEOGAMES PROGRAMMING", (Vector2){ screenWidth/2 - MeasureTextEx(fontAlagard, "LEARN VIDEOGAMES PROGRAMMING", GetFontBaseSize(fontAlagard)*4, 4).x/2, 80 }, GetFontBaseSize(fontAlagard)*4, 4, MAROON);

                DrawTexture(raylibLogoA, logoPositionX, logoPositionY - 40, WHITE);

                DrawText(msgWeb, screenWidth/2 - MeasureText(msgWeb, 40)/2, 470, 40, DARKGRAY);

                if (framesCounter > 60) DrawText(msgCredits, screenWidth/2 - MeasureText(msgCredits, 30)/2, 550, 30, GRAY);

                if (framesCounter > 120) if ((framesCounter/30)%2) DrawText("PRESS ENTER to CONTINUE", screenWidth/2 - MeasureText("PRESS ENTER to CONTINUE", 20)/2, 640, 20, LIGHTGRAY);

            } break;
            case PONG:
            {
                // Pong
                DrawCircleV(pongBallPosition, 10, LIGHTGRAY);
                DrawRectangleRec(pongPlayerRec, GRAY);
                DrawRectangleRec(pongEnemyRec, GRAY);

                DrawText(FormatText("%02i", pongScorePlayer), 150, 10, 80, LIGHTGRAY);
                DrawText(FormatText("%02i", pongScoreEnemy), screenWidth - MeasureText("00", 80) - 150, 10, 80, LIGHTGRAY);

                if (pongPaused) if ((framesCounter/30)%2) DrawText("GAME PAUSED [P]", screenWidth/2 - 100, 40, 20, MAROON);
            } break;
            default: break;
        }

        if (currentScreen != LOADING) DrawRectangle(0, screenHeight - 10, ((float)timeCounter/(float)totalTime)*screenWidth, 10, LIGHTGRAY);

        if (onTransition) DrawTransition();

    EndDrawing();
    //----------------------------------------------------------------------------------
}
Ejemplo n.º 7
0
// Ending Screen Draw logic
void DrawEndingScreen(void)
{
    for (int x = 0; x < 15; x++)
    {
        DrawTextureRec(atlas02, ending_background, (Vector2){ending_background.width*(x%5), ending_background.height*(x/5)}, backgroundColor);
    }
    
    // Frames and backgrounds
    DrawTexturePro(atlas01, ending_plate_frame, (Rectangle){GetScreenWidth()*0.042, GetScreenHeight()*0.606, ending_plate_frame.width, ending_plate_frame.height}, (Vector2){ 0, 0}, 0, WHITE);
    DrawTexturePro(atlas01, ending_paint_back, (Rectangle){GetScreenWidth()*0.133, GetScreenHeight()*0.097, ending_paint_back.width, ending_paint_back.height}, (Vector2){ 0, 0}, 0, WHITE);
    
    if (killer == 0) DrawTexturePro(atlas01, ending_paint_koalafire, (Rectangle){GetScreenWidth()*0.145, GetScreenHeight()*0.171, ending_paint_koalafire.width, ending_paint_koalafire.height}, (Vector2){ 0, 0}, 0, WHITE);
    else if (killer == 1) DrawTexturePro(atlas01, ending_paint_koalasnake, (Rectangle){GetScreenWidth()*0.145, GetScreenHeight()*0.171, ending_paint_koalasnake.width, ending_paint_koalasnake.height}, (Vector2){ 0, 0}, 0, WHITE);
    else if (killer == 2) DrawTexturePro(atlas01, ending_paint_koaladingo, (Rectangle){GetScreenWidth()*0.145, GetScreenHeight()*0.171, ending_paint_koaladingo.width, ending_paint_koaladingo.height}, (Vector2){ 0, 0}, 0, WHITE);
    else if (killer == 3) DrawTexturePro(atlas01, ending_paint_koalaowl, (Rectangle){GetScreenWidth()*0.2, GetScreenHeight()*0.3, ending_paint_koalaowl.width, ending_paint_koalaowl.height}, (Vector2){ 0, 0}, 0, WHITE);
    else if (killer == 4) DrawTexturePro(atlas01, ending_paint_koalageneric, (Rectangle){GetScreenWidth()*0.133, GetScreenHeight()*0.171, ending_paint_koalageneric.width, ending_paint_koalageneric.height}, (Vector2){ 0, 0}, 0, WHITE);
    else if (killer == 5) DrawTexturePro(atlas01, ending_paint_koalabee, (Rectangle){GetScreenWidth()*0.145, GetScreenHeight()*0.171, ending_paint_koalabee.width, ending_paint_koalabee.height}, (Vector2){ 0, 0}, 0, WHITE);
    else if (killer == 6) DrawTexturePro(atlas01, ending_paint_koalaeagle, (Rectangle){GetScreenWidth()*0.145, GetScreenHeight()*0.171, ending_paint_koalaeagle.width, ending_paint_koalaeagle.height}, (Vector2){ 0, 0}, 0, WHITE);
    
    DrawTexturePro(atlas01, ending_paint_frame, (Rectangle){GetScreenWidth()*0.102, GetScreenHeight()*0.035, ending_paint_frame.width, ending_paint_frame.height}, (Vector2){ 0, 0}, 0, WHITE);
    
    // UI Score planks
    DrawTexturePro(atlas01, ending_score_planksmall, (Rectangle){GetScreenWidth()*0.521, GetScreenHeight()*0.163, ending_score_planksmall.width, ending_score_planksmall.height}, (Vector2){ 0, 0}, 0, WHITE);
    DrawTexturePro(atlas01, ending_score_planklarge, (Rectangle){GetScreenWidth()*0.415, GetScreenHeight()*0.303, ending_score_planklarge.width, ending_score_planklarge.height}, (Vector2){ 0, 0}, 0, WHITE);
    DrawTexturePro(atlas01, ending_score_planksmall, (Rectangle){GetScreenWidth()*0.521, GetScreenHeight()*0.440, ending_score_planksmall.width, ending_score_planksmall.height}, (Vector2){ 0, 0}, 0, WHITE);
    
    // UI Score icons and frames
    DrawTexturePro(atlas01, ending_score_seasonicon, (Rectangle){GetScreenWidth()*0.529, GetScreenHeight()*0.096, ending_score_seasonicon.width, ending_score_seasonicon.height}, (Vector2){ 0, 0}, 0, WHITE);
    DrawTexturePro(atlas01, ending_score_seasonneedle, (Rectangle){GetScreenWidth()*0.579, GetScreenHeight()*0.189, ending_score_seasonneedle.width, ending_score_seasonneedle.height}, (Vector2){ending_score_seasonneedle.width/2, ending_score_seasonneedle.height*0.9}, clockRotation, WHITE);
    DrawTexturePro(atlas01, ending_score_frame, (Rectangle){GetScreenWidth()*0.535, GetScreenHeight()*0.11, ending_score_frame.width, ending_score_frame.height}, (Vector2){ 0, 0}, 0, WHITE);
    
    DrawTexturePro(atlas01, ending_score_frameback, (Rectangle){GetScreenWidth()*0.430, GetScreenHeight()*0.246, ending_score_frameback.width, ending_score_frameback.height}, (Vector2){ 0, 0}, 0, WHITE);
    DrawTexturePro(atlas01, ending_score_frame, (Rectangle){GetScreenWidth()*0.429, GetScreenHeight()*0.244, ending_score_frame.width, ending_score_frame.height}, (Vector2){ 0, 0}, 0, WHITE);
   
    for (int i = 0; i < 20; i++)
    {
        if (leafParticles[i].active)
        {                
            DrawTexturePro(atlas01, particle_ecualyptusleaf,
                          (Rectangle){ leafParticles[i].position.x, leafParticles[i].position.y, particle_ecualyptusleaf.width*leafParticles[i].size, particle_ecualyptusleaf.height*leafParticles[i].size },
                          (Vector2){ particle_ecualyptusleaf.width/2*leafParticles[i].size, particle_ecualyptusleaf.height/2*leafParticles[i].size }, leafParticles[i].rotation, Fade(WHITE,leafParticles[i].alpha));        
        }
    }
    
    DrawTexturePro(atlas01, ending_score_leavesicon, (Rectangle){GetScreenWidth()*0.421, GetScreenHeight()*0.228, ending_score_leavesicon.width, ending_score_leavesicon.height}, (Vector2){ 0, 0}, 0, WHITE);
    
    DrawTexturePro(atlas01, ending_score_frameback, (Rectangle){GetScreenWidth()*0.536, GetScreenHeight()*0.383, ending_score_frameback.width, ending_score_frameback.height}, (Vector2){ 0, 0}, 0, WHITE);
    DrawTexturePro(atlas01, ending_score_frame, (Rectangle){GetScreenWidth()*0.535, GetScreenHeight()*0.383, ending_score_frame.width, ending_score_frame.height}, (Vector2){ 0, 0}, 0, WHITE);
    DrawTexturePro(atlas01, ending_score_enemyicon, (Rectangle){GetScreenWidth()*0.538, GetScreenHeight()*0.414, ending_score_enemyicon.width, ending_score_enemyicon.height}, (Vector2){ 0, 0}, 0, WHITE);
    
    // UI Buttons
    DrawTexturePro(atlas01, ending_button_replay, (Rectangle){GetScreenWidth()*0.871, GetScreenHeight()*0.096, ending_button_replay.width, ending_button_replay.height}, (Vector2){ 0, 0}, 0, buttonPlayColor);
    DrawTexturePro(atlas01, ending_button_shop, (Rectangle){GetScreenWidth()*0.871, GetScreenHeight()*0.303, ending_button_shop.width, ending_button_shop.height}, (Vector2){ 0, 0}, 0, buttonShopColor);
    DrawTexturePro(atlas01, ending_button_trophy, (Rectangle){GetScreenWidth()*0.871, GetScreenHeight()*0.513, ending_button_trophy.width, ending_button_trophy.height}, (Vector2){ 0, 0}, 0, buttonTrophyColor);
    DrawTexturePro(atlas01, ending_button_share, (Rectangle){GetScreenWidth()*0.871, GetScreenHeight()*0.719, ending_button_share.width, ending_button_share.height}, (Vector2){ 0, 0}, 0, buttonShareColor);
    
    DrawTextEx(font, FormatText("%03i", seasonsCounter), (Vector2){ GetScreenWidth()*0.73f, GetScreenHeight()*0.14f }, font.baseSize, 1, WHITE);
    DrawTextEx(font, FormatText("%03i", currentLeavesEnding), (Vector2){ GetScreenWidth()*0.73f, GetScreenHeight()*0.29f }, font.baseSize, 1, WHITE);
    DrawTextEx(font, FormatText("%04i", currentScore), (Vector2){ GetScreenWidth()*0.715f, GetScreenHeight()*0.426f }, font.baseSize, 1, WHITE);
    
    DrawTextEx(font, FormatText("%s %i - %s %i", initMonthText, initYears, finalMonthText, finalYears), (Vector2){ GetScreenWidth()*0.1f, GetScreenHeight()*0.7f }, font.baseSize/2.0f, 1, WHITE);
    
    for (int i = 0; i < MAX_KILLS; i++)
    {
        if (active[i])
        {
            switch (killHistory[i])
            {
                case 1: DrawTextureRec(atlas01, ending_plate_headsnake, (Vector2){GetScreenWidth()*0.448 + ending_plate_headsnake.width*(i%10), GetScreenHeight()*0.682  + (GetScreenHeight()*0.055)*(i/10)}, WHITE); break;
                case 2: DrawTextureRec(atlas01, ending_plate_headdingo, (Vector2){GetScreenWidth()*0.448 + ending_plate_headdingo.width*(i%10), GetScreenHeight()*0.682  + (GetScreenHeight()*0.055)*(i/10)}, WHITE); break;
                case 3: DrawTextureRec(atlas01, ending_plate_headowl, (Vector2){GetScreenWidth()*0.448 + ending_plate_headowl.width*(i%10), GetScreenHeight()*0.682  + (GetScreenHeight()*0.055)*(i/10)}, WHITE); break;
                case 4: DrawTextureRec(atlas01, ending_plate_headbee, (Vector2){GetScreenWidth()*0.448 + ending_plate_headbee.width*(i%10), GetScreenHeight()*0.682  + (GetScreenHeight()*0.055)*(i/10)}, WHITE); break;
                case 5: DrawTextureRec(atlas01, ending_plate_headeagle, (Vector2){GetScreenWidth()*0.448 + ending_plate_headeagle.width*(i%10), GetScreenHeight()*0.682  + (GetScreenHeight()*0.055)*(i/10)}, WHITE); break;
                default: break;
            }
        }
    }
    
/*
    DrawText(FormatText("KOALA IS DEAD :("), GetScreenWidth()/2 -  MeasureText("YOU'RE DEAD   ", 60)/2, GetScreenHeight()/3, 60, RED);
    DrawText(FormatText("Score: %02i - HiScore: %02i", score, hiscore),GetScreenWidth()/2 -  MeasureText("Score: 00 - HiScore: 00", 60)/2, GetScreenHeight()/3 +100, 60, RED);
    DrawText(FormatText("You lived: %02i years", years),GetScreenWidth()/2 -  MeasureText("You lived: 00", 60)/2 + 60, GetScreenHeight()/3 +200, 30, RED);
    DrawText(FormatText("%02s killed you", killer),GetScreenWidth()/2 -  MeasureText("killer killed you", 60)/2 + 90, GetScreenHeight()/3 +270, 30, RED);
    //DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), Fade(BLACK, 0.5));
*/
    
    //DrawTextEx(font, FormatText("%02s", killer), (Vector2){ GetScreenWidth()*0.08, GetScreenHeight()*0.78 }, font.baseSize/2, 1, WHITE);
    if (killer == 0) DrawTextEx(font, textFire01, (Vector2){ GetScreenWidth()*0.13f, GetScreenHeight()*0.78f }, font.baseSize/2.0f, 1, WHITE);
    else if (killer == 2) DrawTextEx(font, textDingo01, (Vector2){ GetScreenWidth()*0.13f, GetScreenHeight()*0.78f }, font.baseSize/2.0f, 1, WHITE);
    else if (killer == 1) 
    {
        DrawTextEx(font, textSnake01, (Vector2){ GetScreenWidth()*0.13f, GetScreenHeight()*0.78f }, font.baseSize/2.0f, 1, WHITE);
        DrawTextEx(font, textSnake02, (Vector2){ GetScreenWidth()*0.13f, GetScreenHeight()*0.83f }, font.baseSize/2.0f, 1, WHITE);
    }
    else if (killer == 3) 
    {
        DrawTextEx(font, textOwl01, (Vector2){ GetScreenWidth()*0.13f, GetScreenHeight()*0.78f }, font.baseSize/2.0f, 1, WHITE);
        DrawTextEx(font, textOwl02, (Vector2){ GetScreenWidth()*0.13f, GetScreenHeight()*0.83f }, font.baseSize/2.0f, 1, WHITE);
    }
    else if (killer == 4) DrawTextEx(font, textNaturalDeath01, (Vector2){ GetScreenWidth()*0.13f, GetScreenHeight()*0.78f }, font.baseSize/2.0f, 1, WHITE);
    else if (killer == 5) 
    {
        DrawTextEx(font, textBee01, (Vector2){ GetScreenWidth()*0.13f, GetScreenHeight()*0.78f }, font.baseSize/2.0f, 1, WHITE);
        DrawTextEx(font, textBee02, (Vector2){ GetScreenWidth()*0.13f, GetScreenHeight()*0.83f }, font.baseSize/2.0f, 1, WHITE);
    }
    else if (killer == 6) DrawTextEx(font, textEagle, (Vector2){ GetScreenWidth()*0.13f, GetScreenHeight()*0.78f }, font.baseSize/2.0f, 1, WHITE);
}