Fixing all other macros by adding RL_ prefix.
This commit is contained in:
parent
8579d1386d
commit
b6cb51e3e8
8 changed files with 1821 additions and 1821 deletions
|
|
@ -85,29 +85,29 @@ int main()
|
|||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
|
||||
ClearBackground(RAYWHITE);
|
||||
ClearBackground(RL_RAYWHITE);
|
||||
|
||||
switch (currentScreen)
|
||||
{
|
||||
case TITLE:
|
||||
{
|
||||
// Draw title screen
|
||||
DrawRectangle(0, 0, screenWidth, screenHeight, GREEN);
|
||||
DrawText("TITLE SCREEN", 20, 20, 40, DARKGREEN);
|
||||
DrawRectangle(0, 0, screenWidth, screenHeight, RL_GREEN);
|
||||
DrawText("TITLE SCREEN", 20, 20, 40, RL_DARKGREEN);
|
||||
|
||||
} break;
|
||||
case GAMEPLAY:
|
||||
{
|
||||
// Draw gameplay screen
|
||||
DrawRectangle(0, 0, screenWidth, screenHeight, RED);
|
||||
DrawText("GAMEPLAY SCREEN", 20, 20, 40, MAROON);
|
||||
DrawRectangle(0, 0, screenWidth, screenHeight, RL_RED);
|
||||
DrawText("GAMEPLAY SCREEN", 20, 20, 40, RL_MAROON);
|
||||
|
||||
} break;
|
||||
case ENDING:
|
||||
{
|
||||
// Draw ending screen
|
||||
DrawRectangle(0, 0, screenWidth, screenHeight, BLUE);
|
||||
DrawText("ENDING SCREEN", 20, 20, 40, DARKBLUE);
|
||||
DrawRectangle(0, 0, screenWidth, screenHeight, RL_BLUE);
|
||||
DrawText("ENDING SCREEN", 20, 20, 40, RL_DARKBLUE);
|
||||
|
||||
} break;
|
||||
default: break;
|
||||
|
|
|
|||
|
|
@ -106,29 +106,29 @@ int main()
|
|||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
|
||||
ClearBackground(RAYWHITE);
|
||||
ClearBackground(RL_RAYWHITE);
|
||||
|
||||
// Draw background (common to all screens)
|
||||
DrawTexture(sky, 0, 0, WHITE);
|
||||
DrawTexture(sky, 0, 0, RL_WHITE);
|
||||
|
||||
DrawTexture(mountains, backScrolling, 0, WHITE);
|
||||
DrawTexture(mountains, screenWidth + backScrolling, 0, WHITE);
|
||||
DrawTexture(mountains, backScrolling, 0, RL_WHITE);
|
||||
DrawTexture(mountains, screenWidth + backScrolling, 0, RL_WHITE);
|
||||
|
||||
DrawTexture(sea, seaScrolling, 0, BLUE);
|
||||
DrawTexture(sea, screenWidth + seaScrolling, 0, BLUE);
|
||||
DrawTexture(sea, seaScrolling, 0, RL_BLUE);
|
||||
DrawTexture(sea, screenWidth + seaScrolling, 0, RL_BLUE);
|
||||
|
||||
switch (currentScreen)
|
||||
{
|
||||
case TITLE:
|
||||
{
|
||||
// Draw title screen
|
||||
DrawText("PRESS ENTER", 450, 420, 40, BLACK);
|
||||
DrawText("PRESS ENTER", 450, 420, 40, RL_BLACK);
|
||||
|
||||
} break;
|
||||
case GAMEPLAY:
|
||||
{
|
||||
// Draw gameplay screen
|
||||
DrawText("GAMEPLAY SCREEN", 20, 20, 40, MAROON);
|
||||
DrawText("GAMEPLAY SCREEN", 20, 20, 40, RL_MAROON);
|
||||
|
||||
} break;
|
||||
case ENDING:
|
||||
|
|
@ -136,9 +136,9 @@ int main()
|
|||
// Draw ending screen
|
||||
|
||||
// Draw a transparent black rectangle that covers all screen
|
||||
DrawRectangle(0, 0, screenWidth, screenHeight, Fade(BLACK, 0.4f));
|
||||
DrawRectangle(0, 0, screenWidth, screenHeight, Fade(RL_BLACK, 0.4f));
|
||||
|
||||
DrawText("ENDING SCREEN", 20, 20, 40, DARKBLUE);
|
||||
DrawText("ENDING SCREEN", 20, 20, 40, RL_DARKBLUE);
|
||||
|
||||
} break;
|
||||
default: break;
|
||||
|
|
|
|||
|
|
@ -134,23 +134,23 @@ int main()
|
|||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
|
||||
ClearBackground(RAYWHITE);
|
||||
ClearBackground(RL_RAYWHITE);
|
||||
|
||||
// Draw background (common to all screens)
|
||||
DrawTexture(sky, 0, 0, WHITE);
|
||||
DrawTexture(sky, 0, 0, RL_WHITE);
|
||||
|
||||
DrawTexture(mountains, backScrolling, 0, WHITE);
|
||||
DrawTexture(mountains, screenWidth + backScrolling, 0, WHITE);
|
||||
DrawTexture(mountains, backScrolling, 0, RL_WHITE);
|
||||
DrawTexture(mountains, screenWidth + backScrolling, 0, RL_WHITE);
|
||||
|
||||
if (!gameraMode)
|
||||
{
|
||||
DrawTexture(sea, seaScrolling, 0, BLUE);
|
||||
DrawTexture(sea, screenWidth + seaScrolling, 0, BLUE);
|
||||
DrawTexture(sea, seaScrolling, 0, RL_BLUE);
|
||||
DrawTexture(sea, screenWidth + seaScrolling, 0, RL_BLUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
DrawTexture(sea, seaScrolling, 0, RED);
|
||||
DrawTexture(sea, screenWidth + seaScrolling, 0, RED);
|
||||
DrawTexture(sea, seaScrolling, 0, RL_RED);
|
||||
DrawTexture(sea, screenWidth + seaScrolling, 0, RL_RED);
|
||||
}
|
||||
|
||||
switch (currentScreen)
|
||||
|
|
@ -158,33 +158,33 @@ int main()
|
|||
case TITLE:
|
||||
{
|
||||
// Draw title
|
||||
//DrawTexture(title, screenWidth/2 - title.width/2, screenHeight/2 - title.height/2 - 80, WHITE);
|
||||
DrawRectangle(380, 140, 500, 300, GRAY);
|
||||
//DrawTexture(title, screenWidth/2 - title.width/2, screenHeight/2 - title.height/2 - 80, RL_WHITE);
|
||||
DrawRectangle(380, 140, 500, 300, RL_GRAY);
|
||||
|
||||
// Draw blinking text
|
||||
if ((framesCounter/30) % 2) DrawText("PRESS ENTER", 480, 480, 40, BLACK);
|
||||
if ((framesCounter/30) % 2) DrawText("PRESS ENTER", 480, 480, 40, RL_BLACK);
|
||||
|
||||
} break;
|
||||
case GAMEPLAY:
|
||||
{
|
||||
// Draw player
|
||||
//if (!gameraMode) DrawTexture(turtle, playerBounds.x - 14, playerBounds.y - 14, WHITE);
|
||||
//else DrawTexture(gamera, playerBounds.x - 64, playerBounds.y - 64, WHITE);
|
||||
//if (!gameraMode) DrawTexture(turtle, playerBounds.x - 14, playerBounds.y - 14, RL_WHITE);
|
||||
//else DrawTexture(gamera, playerBounds.x - 64, playerBounds.y - 64, RL_WHITE);
|
||||
|
||||
// Draw player bounding box
|
||||
if (!gameraMode) DrawRectangleRec(playerBounds, GREEN);
|
||||
else DrawRectangleRec(playerBounds, ORANGE);
|
||||
if (!gameraMode) DrawRectangleRec(playerBounds, RL_GREEN);
|
||||
else DrawRectangleRec(playerBounds, RL_ORANGE);
|
||||
|
||||
} break;
|
||||
case ENDING:
|
||||
{
|
||||
// Draw a transparent black rectangle that covers all screen
|
||||
DrawRectangle(0, 0, screenWidth, screenHeight, Fade(BLACK, 0.4f));
|
||||
DrawRectangle(0, 0, screenWidth, screenHeight, Fade(RL_BLACK, 0.4f));
|
||||
|
||||
DrawText("GAME OVER", 300, 200, 100, MAROON);
|
||||
DrawText("GAME OVER", 300, 200, 100, RL_MAROON);
|
||||
|
||||
// Draw blinking text
|
||||
if ((framesCounter/30) % 2) DrawText("PRESS ENTER to REPLAY", 400, 420, 30, LIGHTGRAY);
|
||||
if ((framesCounter/30) % 2) DrawText("PRESS ENTER to REPLAY", 400, 420, 30, RL_LIGHTGRAY);
|
||||
|
||||
} break;
|
||||
default: break;
|
||||
|
|
|
|||
|
|
@ -268,23 +268,23 @@ int main()
|
|||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
|
||||
ClearBackground(RAYWHITE);
|
||||
ClearBackground(RL_RAYWHITE);
|
||||
|
||||
// Draw background (common to all screens)
|
||||
DrawTexture(sky, 0, 0, WHITE);
|
||||
DrawTexture(sky, 0, 0, RL_WHITE);
|
||||
|
||||
DrawTexture(mountains, backScrolling, 0, WHITE);
|
||||
DrawTexture(mountains, screenWidth + backScrolling, 0, WHITE);
|
||||
DrawTexture(mountains, backScrolling, 0, RL_WHITE);
|
||||
DrawTexture(mountains, screenWidth + backScrolling, 0, RL_WHITE);
|
||||
|
||||
if (!gameraMode)
|
||||
{
|
||||
DrawTexture(sea, seaScrolling, 0, BLUE);
|
||||
DrawTexture(sea, screenWidth + seaScrolling, 0, BLUE);
|
||||
DrawTexture(sea, seaScrolling, 0, RL_BLUE);
|
||||
DrawTexture(sea, screenWidth + seaScrolling, 0, RL_BLUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
DrawTexture(sea, seaScrolling, 0, RED);
|
||||
DrawTexture(sea, screenWidth + seaScrolling, 0, RED);
|
||||
DrawTexture(sea, seaScrolling, 0, RL_RED);
|
||||
DrawTexture(sea, screenWidth + seaScrolling, 0, RL_RED);
|
||||
}
|
||||
|
||||
switch (currentScreen)
|
||||
|
|
@ -292,24 +292,24 @@ int main()
|
|||
case TITLE:
|
||||
{
|
||||
// Draw title
|
||||
DrawTexture(title, screenWidth/2 - title.width/2, screenHeight/2 - title.height/2 - 80, WHITE);
|
||||
DrawTexture(title, screenWidth/2 - title.width/2, screenHeight/2 - title.height/2 - 80, RL_WHITE);
|
||||
|
||||
// Draw blinking text
|
||||
if ((framesCounter/30) % 2) DrawText("PRESS ENTER", 480, 480, 40, BLACK);
|
||||
if ((framesCounter/30) % 2) DrawText("PRESS ENTER", 480, 480, 40, RL_BLACK);
|
||||
|
||||
} break;
|
||||
case GAMEPLAY:
|
||||
{
|
||||
// Draw water lines
|
||||
for (int i = 0; i < 5; i++) DrawRectangle(0, i*120 + 120, screenWidth, 110, Fade(SKYBLUE, 0.1f));
|
||||
for (int i = 0; i < 5; i++) DrawRectangle(0, i*120 + 120, screenWidth, 110, Fade(RL_SKYBLUE, 0.1f));
|
||||
|
||||
// Draw player
|
||||
if (!gameraMode) DrawTexture(turtle, playerBounds.x - 14, playerBounds.y - 14, WHITE);
|
||||
else DrawTexture(gamera, playerBounds.x - 64, playerBounds.y - 64, WHITE);
|
||||
if (!gameraMode) DrawTexture(turtle, playerBounds.x - 14, playerBounds.y - 14, RL_WHITE);
|
||||
else DrawTexture(gamera, playerBounds.x - 64, playerBounds.y - 64, RL_WHITE);
|
||||
|
||||
// Draw player bounding box
|
||||
//if (!gameraMode) DrawRectangleRec(playerBounds, Fade(GREEN, 0.4f));
|
||||
//else DrawRectangleRec(playerBounds, Fade(ORANGE, 0.4f));
|
||||
//if (!gameraMode) DrawRectangleRec(playerBounds, Fade(RL_GREEN, 0.4f));
|
||||
//else DrawRectangleRec(playerBounds, Fade(RL_ORANGE, 0.4f));
|
||||
|
||||
// Draw enemies
|
||||
for (int i = 0; i < MAX_ENEMIES; i++)
|
||||
|
|
@ -320,10 +320,10 @@ int main()
|
|||
/*
|
||||
switch(enemyType[i])
|
||||
{
|
||||
case 0: DrawTexture(shark, enemyBounds[i].x - 14, enemyBounds[i].y - 14, WHITE); break;
|
||||
case 1: DrawTexture(orca, enemyBounds[i].x - 14, enemyBounds[i].y - 14, WHITE); break;
|
||||
case 2: DrawTexture(swhale, enemyBounds[i].x - 14, enemyBounds[i].y - 14, WHITE); break;
|
||||
case 3: DrawTexture(fish, enemyBounds[i].x - 14, enemyBounds[i].y - 14, WHITE); break;
|
||||
case 0: DrawTexture(shark, enemyBounds[i].x - 14, enemyBounds[i].y - 14, RL_WHITE); break;
|
||||
case 1: DrawTexture(orca, enemyBounds[i].x - 14, enemyBounds[i].y - 14, RL_WHITE); break;
|
||||
case 2: DrawTexture(swhale, enemyBounds[i].x - 14, enemyBounds[i].y - 14, RL_WHITE); break;
|
||||
case 3: DrawTexture(fish, enemyBounds[i].x - 14, enemyBounds[i].y - 14, RL_WHITE); break;
|
||||
default: break;
|
||||
}
|
||||
*/
|
||||
|
|
@ -331,10 +331,10 @@ int main()
|
|||
// Draw enemies bounding boxes
|
||||
switch(enemyType[i])
|
||||
{
|
||||
case 0: DrawRectangleRec(enemyBounds[i], RED); break;
|
||||
case 1: DrawRectangleRec(enemyBounds[i], RED); break;
|
||||
case 2: DrawRectangleRec(enemyBounds[i], RED); break;
|
||||
case 3: DrawRectangleRec(enemyBounds[i], GREEN); break;
|
||||
case 0: DrawRectangleRec(enemyBounds[i], RL_RED); break;
|
||||
case 1: DrawRectangleRec(enemyBounds[i], RL_RED); break;
|
||||
case 2: DrawRectangleRec(enemyBounds[i], RL_RED); break;
|
||||
case 3: DrawRectangleRec(enemyBounds[i], RL_GREEN); break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
|
@ -343,25 +343,25 @@ int main()
|
|||
// Draw gameplay interface
|
||||
|
||||
// Draw food bar
|
||||
DrawRectangle(20, 20, 400, 40, Fade(GRAY, 0.4f));
|
||||
DrawRectangle(20, 20, foodBar, 40, ORANGE);
|
||||
DrawRectangleLines(20, 20, 400, 40, BLACK);
|
||||
DrawRectangle(20, 20, 400, 40, Fade(RL_GRAY, 0.4f));
|
||||
DrawRectangle(20, 20, foodBar, 40, RL_ORANGE);
|
||||
DrawRectangleLines(20, 20, 400, 40, RL_BLACK);
|
||||
|
||||
if (gameraMode)
|
||||
{
|
||||
DrawText("GAMERA MODE", 60, 22, 40, GRAY);
|
||||
DrawText("GAMERA MODE", 60, 22, 40, RL_GRAY);
|
||||
}
|
||||
|
||||
} break;
|
||||
case ENDING:
|
||||
{
|
||||
// Draw a transparent black rectangle that covers all screen
|
||||
DrawRectangle(0, 0, screenWidth, screenHeight, Fade(BLACK, 0.4f));
|
||||
DrawRectangle(0, 0, screenWidth, screenHeight, Fade(RL_BLACK, 0.4f));
|
||||
|
||||
DrawText("GAME OVER", 300, 200, 100, MAROON);
|
||||
DrawText("GAME OVER", 300, 200, 100, RL_MAROON);
|
||||
|
||||
// Draw blinking text
|
||||
if ((framesCounter/30) % 2) DrawText("PRESS ENTER to REPLAY", 400, 420, 30, LIGHTGRAY);
|
||||
if ((framesCounter/30) % 2) DrawText("PRESS ENTER to REPLAY", 400, 420, 30, RL_LIGHTGRAY);
|
||||
|
||||
} break;
|
||||
default: break;
|
||||
|
|
|
|||
|
|
@ -311,13 +311,13 @@ int main()
|
|||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
|
||||
ClearBackground(RAYWHITE);
|
||||
ClearBackground(RL_RAYWHITE);
|
||||
|
||||
// Draw background (common to all screens)
|
||||
DrawTexture(sky, 0, 0, WHITE);
|
||||
DrawTexture(sky, 0, 0, RL_WHITE);
|
||||
|
||||
DrawTexture(mountains, backScrolling, 0, WHITE);
|
||||
DrawTexture(mountains, screenWidth + backScrolling, 0, WHITE);
|
||||
DrawTexture(mountains, backScrolling, 0, RL_WHITE);
|
||||
DrawTexture(mountains, screenWidth + backScrolling, 0, RL_WHITE);
|
||||
|
||||
if (!gameraMode)
|
||||
{
|
||||
|
|
@ -335,24 +335,24 @@ int main()
|
|||
case TITLE:
|
||||
{
|
||||
// Draw title
|
||||
DrawTexture(title, screenWidth/2 - title.width/2, screenHeight/2 - title.height/2 - 80, WHITE);
|
||||
DrawTexture(title, screenWidth/2 - title.width/2, screenHeight/2 - title.height/2 - 80, RL_WHITE);
|
||||
|
||||
// Draw blinking text
|
||||
if ((framesCounter/30) % 2) DrawTextEx(font, "PRESS ENTER", (Vector2){ screenWidth/2 - 150, 480 }, font.baseSize, 0, WHITE);
|
||||
if ((framesCounter/30) % 2) DrawTextEx(font, "PRESS ENTER", (Vector2){ screenWidth/2 - 150, 480 }, font.baseSize, 0, RL_WHITE);
|
||||
|
||||
} break;
|
||||
case GAMEPLAY:
|
||||
{
|
||||
// Draw water lines
|
||||
for (int i = 0; i < 5; i++) DrawRectangle(0, i*120 + 120, screenWidth, 110, Fade(SKYBLUE, 0.1f));
|
||||
for (int i = 0; i < 5; i++) DrawRectangle(0, i*120 + 120, screenWidth, 110, Fade(RL_SKYBLUE, 0.1f));
|
||||
|
||||
// Draw player
|
||||
if (!gameraMode) DrawTexture(turtle, playerBounds.x - 14, playerBounds.y - 14, WHITE);
|
||||
else DrawTexture(gamera, playerBounds.x - 64, playerBounds.y - 64, WHITE);
|
||||
if (!gameraMode) DrawTexture(turtle, playerBounds.x - 14, playerBounds.y - 14, RL_WHITE);
|
||||
else DrawTexture(gamera, playerBounds.x - 64, playerBounds.y - 64, RL_WHITE);
|
||||
|
||||
// Draw player bounding box
|
||||
//if (!gameraMode) DrawRectangleRec(playerBounds, Fade(GREEN, 0.4f));
|
||||
//else DrawRectangleRec(playerBounds, Fade(ORANGE, 0.4f));
|
||||
//if (!gameraMode) DrawRectangleRec(playerBounds, Fade(RL_GREEN, 0.4f));
|
||||
//else DrawRectangleRec(playerBounds, Fade(RL_ORANGE, 0.4f));
|
||||
|
||||
// Draw enemies
|
||||
for (int i = 0; i < MAX_ENEMIES; i++)
|
||||
|
|
@ -362,10 +362,10 @@ int main()
|
|||
// Draw enemies
|
||||
switch(enemyType[i])
|
||||
{
|
||||
case 0: DrawTexture(shark, enemyBounds[i].x - 14, enemyBounds[i].y - 14, WHITE); break;
|
||||
case 1: DrawTexture(orca, enemyBounds[i].x - 14, enemyBounds[i].y - 14, WHITE); break;
|
||||
case 2: DrawTexture(swhale, enemyBounds[i].x - 14, enemyBounds[i].y - 14, WHITE); break;
|
||||
case 3: DrawTexture(fish, enemyBounds[i].x - 14, enemyBounds[i].y - 14, WHITE); break;
|
||||
case 0: DrawTexture(shark, enemyBounds[i].x - 14, enemyBounds[i].y - 14, RL_WHITE); break;
|
||||
case 1: DrawTexture(orca, enemyBounds[i].x - 14, enemyBounds[i].y - 14, RL_WHITE); break;
|
||||
case 2: DrawTexture(swhale, enemyBounds[i].x - 14, enemyBounds[i].y - 14, RL_WHITE); break;
|
||||
case 3: DrawTexture(fish, enemyBounds[i].x - 14, enemyBounds[i].y - 14, RL_WHITE); break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
|
|
@ -373,10 +373,10 @@ int main()
|
|||
/*
|
||||
switch(enemyType[i])
|
||||
{
|
||||
case 0: DrawRectangleRec(enemyBounds[i], Fade(RED, 0.5f)); break;
|
||||
case 1: DrawRectangleRec(enemyBounds[i], Fade(RED, 0.5f)); break;
|
||||
case 2: DrawRectangleRec(enemyBounds[i], Fade(RED, 0.5f)); break;
|
||||
case 3: DrawRectangleRec(enemyBounds[i], Fade(GREEN, 0.5f)); break;
|
||||
case 0: DrawRectangleRec(enemyBounds[i], Fade(RL_RED, 0.5f)); break;
|
||||
case 1: DrawRectangleRec(enemyBounds[i], Fade(RL_RED, 0.5f)); break;
|
||||
case 2: DrawRectangleRec(enemyBounds[i], Fade(RL_RED, 0.5f)); break;
|
||||
case 3: DrawRectangleRec(enemyBounds[i], Fade(RL_GREEN, 0.5f)); break;
|
||||
default: break;
|
||||
}
|
||||
*/
|
||||
|
|
@ -384,34 +384,34 @@ int main()
|
|||
}
|
||||
|
||||
// Draw gameplay interface
|
||||
DrawRectangle(20, 20, 400, 40, Fade(GRAY, 0.4f));
|
||||
DrawRectangle(20, 20, foodBar, 40, ORANGE);
|
||||
DrawRectangleLines(20, 20, 400, 40, BLACK);
|
||||
DrawRectangle(20, 20, 400, 40, Fade(RL_GRAY, 0.4f));
|
||||
DrawRectangle(20, 20, foodBar, 40, RL_ORANGE);
|
||||
DrawRectangleLines(20, 20, 400, 40, RL_BLACK);
|
||||
|
||||
DrawTextEx(font, FormatText("SCORE: %04i", score), (Vector2){ screenWidth - 300, 20 }, font.baseSize, -2, ORANGE);
|
||||
DrawTextEx(font, FormatText("DISTANCE: %04i", (int)distance), (Vector2){ 550, 20 }, font.baseSize, -2, ORANGE);
|
||||
DrawTextEx(font, FormatText("SCORE: %04i", score), (Vector2){ screenWidth - 300, 20 }, font.baseSize, -2, RL_ORANGE);
|
||||
DrawTextEx(font, FormatText("DISTANCE: %04i", (int)distance), (Vector2){ 550, 20 }, font.baseSize, -2, RL_ORANGE);
|
||||
|
||||
if (gameraMode)
|
||||
{
|
||||
DrawText("GAMERA MODE", 60, 22, 40, GRAY);
|
||||
DrawTexture(gframe, 0, 0, Fade(WHITE, 0.5f));
|
||||
DrawText("GAMERA MODE", 60, 22, 40, RL_GRAY);
|
||||
DrawTexture(gframe, 0, 0, Fade(RL_WHITE, 0.5f));
|
||||
}
|
||||
|
||||
} break;
|
||||
case ENDING:
|
||||
{
|
||||
// Draw a transparent black rectangle that covers all screen
|
||||
DrawRectangle(0, 0, screenWidth, screenHeight, Fade(BLACK, 0.4f));
|
||||
DrawRectangle(0, 0, screenWidth, screenHeight, Fade(RL_BLACK, 0.4f));
|
||||
|
||||
DrawTextEx(font, "GAME OVER", (Vector2){ 300, 160 }, font.baseSize*3, -2, MAROON);
|
||||
DrawTextEx(font, "GAME OVER", (Vector2){ 300, 160 }, font.baseSize*3, -2, RL_MAROON);
|
||||
|
||||
DrawTextEx(font, FormatText("SCORE: %04i", score), (Vector2){ 680, 350 }, font.baseSize, -2, GOLD);
|
||||
DrawTextEx(font, FormatText("DISTANCE: %04i", (int)distance), (Vector2){ 290, 350 }, font.baseSize, -2, GOLD);
|
||||
DrawTextEx(font, FormatText("HISCORE: %04i", hiscore), (Vector2){ 665, 400 }, font.baseSize, -2, ORANGE);
|
||||
DrawTextEx(font, FormatText("HIDISTANCE: %04i", (int)hidistance), (Vector2){ 270, 400 }, font.baseSize, -2, ORANGE);
|
||||
DrawTextEx(font, FormatText("SCORE: %04i", score), (Vector2){ 680, 350 }, font.baseSize, -2, RL_GOLD);
|
||||
DrawTextEx(font, FormatText("DISTANCE: %04i", (int)distance), (Vector2){ 290, 350 }, font.baseSize, -2, RL_GOLD);
|
||||
DrawTextEx(font, FormatText("HISCORE: %04i", hiscore), (Vector2){ 665, 400 }, font.baseSize, -2, RL_ORANGE);
|
||||
DrawTextEx(font, FormatText("HIDISTANCE: %04i", (int)hidistance), (Vector2){ 270, 400 }, font.baseSize, -2, RL_ORANGE);
|
||||
|
||||
// Draw blinking text
|
||||
if ((framesCounter/30) % 2) DrawTextEx(font, "PRESS ENTER to REPLAY", (Vector2){ screenWidth/2 - 250, 520 }, font.baseSize, -2, LIGHTGRAY);
|
||||
if ((framesCounter/30) % 2) DrawTextEx(font, "PRESS ENTER to REPLAY", (Vector2){ screenWidth/2 - 250, 520 }, font.baseSize, -2, RL_LIGHTGRAY);
|
||||
|
||||
} break;
|
||||
default: break;
|
||||
|
|
|
|||
|
|
@ -327,13 +327,13 @@ int main()
|
|||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
|
||||
ClearBackground(RAYWHITE);
|
||||
ClearBackground(RL_RAYWHITE);
|
||||
|
||||
// Draw background (common to all screens)
|
||||
DrawTexture(sky, 0, 0, WHITE);
|
||||
DrawTexture(sky, 0, 0, RL_WHITE);
|
||||
|
||||
DrawTexture(mountains, backScrolling, 0, WHITE);
|
||||
DrawTexture(mountains, screenWidth + backScrolling, 0, WHITE);
|
||||
DrawTexture(mountains, backScrolling, 0, RL_WHITE);
|
||||
DrawTexture(mountains, screenWidth + backScrolling, 0, RL_WHITE);
|
||||
|
||||
if (!gameraMode)
|
||||
{
|
||||
|
|
@ -351,24 +351,24 @@ int main()
|
|||
case TITLE:
|
||||
{
|
||||
// Draw title
|
||||
DrawTexture(title, screenWidth/2 - title.width/2, screenHeight/2 - title.height/2 - 80, WHITE);
|
||||
DrawTexture(title, screenWidth/2 - title.width/2, screenHeight/2 - title.height/2 - 80, RL_WHITE);
|
||||
|
||||
// Draw blinking text
|
||||
if ((framesCounter/30) % 2) DrawTextEx(font, "PRESS ENTER", (Vector2){ screenWidth/2 - 150, 480 }, font.baseSize, 0, WHITE);
|
||||
if ((framesCounter/30) % 2) DrawTextEx(font, "PRESS ENTER", (Vector2){ screenWidth/2 - 150, 480 }, font.baseSize, 0, RL_WHITE);
|
||||
|
||||
} break;
|
||||
case GAMEPLAY:
|
||||
{
|
||||
// Draw water lines
|
||||
for (int i = 0; i < 5; i++) DrawRectangle(0, i*120 + 120, screenWidth, 110, Fade(SKYBLUE, 0.1f));
|
||||
for (int i = 0; i < 5; i++) DrawRectangle(0, i*120 + 120, screenWidth, 110, Fade(RL_SKYBLUE, 0.1f));
|
||||
|
||||
// Draw player
|
||||
if (!gameraMode) DrawTexture(turtle, playerBounds.x - 14, playerBounds.y - 14, WHITE);
|
||||
else DrawTexture(gamera, playerBounds.x - 64, playerBounds.y - 64, WHITE);
|
||||
if (!gameraMode) DrawTexture(turtle, playerBounds.x - 14, playerBounds.y - 14, RL_WHITE);
|
||||
else DrawTexture(gamera, playerBounds.x - 64, playerBounds.y - 64, RL_WHITE);
|
||||
|
||||
// Draw player bounding box
|
||||
//if (!gameraMode) DrawRectangleRec(playerBounds, Fade(GREEN, 0.4f));
|
||||
//else DrawRectangleRec(playerBounds, Fade(ORANGE, 0.4f));
|
||||
//if (!gameraMode) DrawRectangleRec(playerBounds, Fade(RL_GREEN, 0.4f));
|
||||
//else DrawRectangleRec(playerBounds, Fade(RL_ORANGE, 0.4f));
|
||||
|
||||
// Draw enemies
|
||||
for (int i = 0; i < MAX_ENEMIES; i++)
|
||||
|
|
@ -378,10 +378,10 @@ int main()
|
|||
// Draw enemies
|
||||
switch(enemyType[i])
|
||||
{
|
||||
case 0: DrawTexture(shark, enemyBounds[i].x - 14, enemyBounds[i].y - 14, WHITE); break;
|
||||
case 1: DrawTexture(orca, enemyBounds[i].x - 14, enemyBounds[i].y - 14, WHITE); break;
|
||||
case 2: DrawTexture(swhale, enemyBounds[i].x - 14, enemyBounds[i].y - 14, WHITE); break;
|
||||
case 3: DrawTexture(fish, enemyBounds[i].x - 14, enemyBounds[i].y - 14, WHITE); break;
|
||||
case 0: DrawTexture(shark, enemyBounds[i].x - 14, enemyBounds[i].y - 14, RL_WHITE); break;
|
||||
case 1: DrawTexture(orca, enemyBounds[i].x - 14, enemyBounds[i].y - 14, RL_WHITE); break;
|
||||
case 2: DrawTexture(swhale, enemyBounds[i].x - 14, enemyBounds[i].y - 14, RL_WHITE); break;
|
||||
case 3: DrawTexture(fish, enemyBounds[i].x - 14, enemyBounds[i].y - 14, RL_WHITE); break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
|
|
@ -389,10 +389,10 @@ int main()
|
|||
/*
|
||||
switch(enemyType[i])
|
||||
{
|
||||
case 0: DrawRectangleRec(enemyBounds[i], Fade(RED, 0.5f)); break;
|
||||
case 1: DrawRectangleRec(enemyBounds[i], Fade(RED, 0.5f)); break;
|
||||
case 2: DrawRectangleRec(enemyBounds[i], Fade(RED, 0.5f)); break;
|
||||
case 3: DrawRectangleRec(enemyBounds[i], Fade(GREEN, 0.5f)); break;
|
||||
case 0: DrawRectangleRec(enemyBounds[i], Fade(RL_RED, 0.5f)); break;
|
||||
case 1: DrawRectangleRec(enemyBounds[i], Fade(RL_RED, 0.5f)); break;
|
||||
case 2: DrawRectangleRec(enemyBounds[i], Fade(RL_RED, 0.5f)); break;
|
||||
case 3: DrawRectangleRec(enemyBounds[i], Fade(RL_GREEN, 0.5f)); break;
|
||||
default: break;
|
||||
}
|
||||
*/
|
||||
|
|
@ -400,34 +400,34 @@ int main()
|
|||
}
|
||||
|
||||
// Draw gameplay interface
|
||||
DrawRectangle(20, 20, 400, 40, Fade(GRAY, 0.4f));
|
||||
DrawRectangle(20, 20, foodBar, 40, ORANGE);
|
||||
DrawRectangleLines(20, 20, 400, 40, BLACK);
|
||||
DrawRectangle(20, 20, 400, 40, Fade(RL_GRAY, 0.4f));
|
||||
DrawRectangle(20, 20, foodBar, 40, RL_ORANGE);
|
||||
DrawRectangleLines(20, 20, 400, 40, RL_BLACK);
|
||||
|
||||
DrawTextEx(font, FormatText("SCORE: %04i", score), (Vector2){ screenWidth - 300, 20 }, font.baseSize, -2, ORANGE);
|
||||
DrawTextEx(font, FormatText("DISTANCE: %04i", (int)distance), (Vector2){ 550, 20 }, font.baseSize, -2, ORANGE);
|
||||
DrawTextEx(font, FormatText("SCORE: %04i", score), (Vector2){ screenWidth - 300, 20 }, font.baseSize, -2, RL_ORANGE);
|
||||
DrawTextEx(font, FormatText("DISTANCE: %04i", (int)distance), (Vector2){ 550, 20 }, font.baseSize, -2, RL_ORANGE);
|
||||
|
||||
if (gameraMode)
|
||||
{
|
||||
DrawText("GAMERA MODE", 60, 22, 40, GRAY);
|
||||
DrawTexture(gframe, 0, 0, Fade(WHITE, 0.5f));
|
||||
DrawText("GAMERA MODE", 60, 22, 40, RL_GRAY);
|
||||
DrawTexture(gframe, 0, 0, Fade(RL_WHITE, 0.5f));
|
||||
}
|
||||
|
||||
} break;
|
||||
case ENDING:
|
||||
{
|
||||
// Draw a transparent black rectangle that covers all screen
|
||||
DrawRectangle(0, 0, screenWidth, screenHeight, Fade(BLACK, 0.4f));
|
||||
DrawRectangle(0, 0, screenWidth, screenHeight, Fade(RL_BLACK, 0.4f));
|
||||
|
||||
DrawTextEx(font, "GAME OVER", (Vector2){ 300, 160 }, font.baseSize*3, -2, MAROON);
|
||||
DrawTextEx(font, "GAME OVER", (Vector2){ 300, 160 }, font.baseSize*3, -2, RL_MAROON);
|
||||
|
||||
DrawTextEx(font, FormatText("SCORE: %04i", score), (Vector2){ 680, 350 }, font.baseSize, -2, GOLD);
|
||||
DrawTextEx(font, FormatText("DISTANCE: %04i", (int)distance), (Vector2){ 290, 350 }, font.baseSize, -2, GOLD);
|
||||
DrawTextEx(font, FormatText("HISCORE: %04i", hiscore), (Vector2){ 665, 400 }, font.baseSize, -2, ORANGE);
|
||||
DrawTextEx(font, FormatText("HIDISTANCE: %04i", (int)hidistance), (Vector2){ 270, 400 }, font.baseSize, -2, ORANGE);
|
||||
DrawTextEx(font, FormatText("SCORE: %04i", score), (Vector2){ 680, 350 }, font.baseSize, -2, RL_GOLD);
|
||||
DrawTextEx(font, FormatText("DISTANCE: %04i", (int)distance), (Vector2){ 290, 350 }, font.baseSize, -2, RL_GOLD);
|
||||
DrawTextEx(font, FormatText("HISCORE: %04i", hiscore), (Vector2){ 665, 400 }, font.baseSize, -2, RL_ORANGE);
|
||||
DrawTextEx(font, FormatText("HIDISTANCE: %04i", (int)hidistance), (Vector2){ 270, 400 }, font.baseSize, -2, RL_ORANGE);
|
||||
|
||||
// Draw blinking text
|
||||
if ((framesCounter/30) % 2) DrawTextEx(font, "PRESS ENTER to REPLAY", (Vector2){ screenWidth/2 - 250, 520 }, font.baseSize, -2, LIGHTGRAY);
|
||||
if ((framesCounter/30) % 2) DrawTextEx(font, "PRESS ENTER to REPLAY", (Vector2){ screenWidth/2 - 250, 520 }, font.baseSize, -2, RL_LIGHTGRAY);
|
||||
|
||||
} break;
|
||||
default: break;
|
||||
|
|
|
|||
|
|
@ -352,13 +352,13 @@ int main()
|
|||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
|
||||
ClearBackground(RAYWHITE);
|
||||
ClearBackground(RL_RAYWHITE);
|
||||
|
||||
// Draw background (common to all screens)
|
||||
DrawTexture(sky, 0, 0, WHITE);
|
||||
DrawTexture(sky, 0, 0, RL_WHITE);
|
||||
|
||||
DrawTexture(mountains, backScrolling, 0, WHITE);
|
||||
DrawTexture(mountains, screenWidth + backScrolling, 0, WHITE);
|
||||
DrawTexture(mountains, backScrolling, 0, RL_WHITE);
|
||||
DrawTexture(mountains, screenWidth + backScrolling, 0, RL_WHITE);
|
||||
|
||||
if (!gameraMode)
|
||||
{
|
||||
|
|
@ -376,24 +376,24 @@ int main()
|
|||
case TITLE:
|
||||
{
|
||||
// Draw title
|
||||
DrawTexture(title, screenWidth/2 - title.width/2, screenHeight/2 - title.height/2 - 80, WHITE);
|
||||
DrawTexture(title, screenWidth/2 - title.width/2, screenHeight/2 - title.height/2 - 80, RL_WHITE);
|
||||
|
||||
// Draw blinking text
|
||||
if ((framesCounter/30) % 2) DrawTextEx(font, "PRESS ENTER", (Vector2){ screenWidth/2 - 150, 480 }, font.baseSize, 0, WHITE);
|
||||
if ((framesCounter/30) % 2) DrawTextEx(font, "PRESS ENTER", (Vector2){ screenWidth/2 - 150, 480 }, font.baseSize, 0, RL_WHITE);
|
||||
|
||||
} break;
|
||||
case GAMEPLAY:
|
||||
{
|
||||
// Draw water lines
|
||||
for (int i = 0; i < 5; i++) DrawRectangle(0, i*120 + 120, screenWidth, 110, Fade(SKYBLUE, 0.1f));
|
||||
for (int i = 0; i < 5; i++) DrawRectangle(0, i*120 + 120, screenWidth, 110, Fade(RL_SKYBLUE, 0.1f));
|
||||
|
||||
// Draw player
|
||||
if (!gameraMode) DrawTexture(turtle, playerBounds.x - 14, playerBounds.y - 14, WHITE);
|
||||
else DrawTexture(gamera, playerBounds.x - 64, playerBounds.y - 64, WHITE);
|
||||
if (!gameraMode) DrawTexture(turtle, playerBounds.x - 14, playerBounds.y - 14, RL_WHITE);
|
||||
else DrawTexture(gamera, playerBounds.x - 64, playerBounds.y - 64, RL_WHITE);
|
||||
|
||||
// Draw player bounding box
|
||||
//if (!gameraMode) DrawRectangleRec(playerBounds, Fade(GREEN, 0.4f));
|
||||
//else DrawRectangleRec(playerBounds, Fade(ORANGE, 0.4f));
|
||||
//if (!gameraMode) DrawRectangleRec(playerBounds, Fade(RL_GREEN, 0.4f));
|
||||
//else DrawRectangleRec(playerBounds, Fade(RL_ORANGE, 0.4f));
|
||||
|
||||
// Draw enemies
|
||||
for (int i = 0; i < MAX_ENEMIES; i++)
|
||||
|
|
@ -403,10 +403,10 @@ int main()
|
|||
// Draw enemies
|
||||
switch(enemyType[i])
|
||||
{
|
||||
case 0: DrawTexture(shark, enemyBounds[i].x - 14, enemyBounds[i].y - 14, WHITE); break;
|
||||
case 1: DrawTexture(orca, enemyBounds[i].x - 14, enemyBounds[i].y - 14, WHITE); break;
|
||||
case 2: DrawTexture(swhale, enemyBounds[i].x - 14, enemyBounds[i].y - 14, WHITE); break;
|
||||
case 3: DrawTexture(fish, enemyBounds[i].x - 14, enemyBounds[i].y - 14, WHITE); break;
|
||||
case 0: DrawTexture(shark, enemyBounds[i].x - 14, enemyBounds[i].y - 14, RL_WHITE); break;
|
||||
case 1: DrawTexture(orca, enemyBounds[i].x - 14, enemyBounds[i].y - 14, RL_WHITE); break;
|
||||
case 2: DrawTexture(swhale, enemyBounds[i].x - 14, enemyBounds[i].y - 14, RL_WHITE); break;
|
||||
case 3: DrawTexture(fish, enemyBounds[i].x - 14, enemyBounds[i].y - 14, RL_WHITE); break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
|
|
@ -414,10 +414,10 @@ int main()
|
|||
/*
|
||||
switch(enemyType[i])
|
||||
{
|
||||
case 0: DrawRectangleRec(enemyBounds[i], Fade(RED, 0.5f)); break;
|
||||
case 1: DrawRectangleRec(enemyBounds[i], Fade(RED, 0.5f)); break;
|
||||
case 2: DrawRectangleRec(enemyBounds[i], Fade(RED, 0.5f)); break;
|
||||
case 3: DrawRectangleRec(enemyBounds[i], Fade(GREEN, 0.5f)); break;
|
||||
case 0: DrawRectangleRec(enemyBounds[i], Fade(RL_RED, 0.5f)); break;
|
||||
case 1: DrawRectangleRec(enemyBounds[i], Fade(RL_RED, 0.5f)); break;
|
||||
case 2: DrawRectangleRec(enemyBounds[i], Fade(RL_RED, 0.5f)); break;
|
||||
case 3: DrawRectangleRec(enemyBounds[i], Fade(RL_GREEN, 0.5f)); break;
|
||||
default: break;
|
||||
}
|
||||
*/
|
||||
|
|
@ -425,34 +425,34 @@ int main()
|
|||
}
|
||||
|
||||
// Draw gameplay interface
|
||||
DrawRectangle(20, 20, 400, 40, Fade(GRAY, 0.4f));
|
||||
DrawRectangle(20, 20, foodBar, 40, ORANGE);
|
||||
DrawRectangleLines(20, 20, 400, 40, BLACK);
|
||||
DrawRectangle(20, 20, 400, 40, Fade(RL_GRAY, 0.4f));
|
||||
DrawRectangle(20, 20, foodBar, 40, RL_ORANGE);
|
||||
DrawRectangleLines(20, 20, 400, 40, RL_BLACK);
|
||||
|
||||
DrawTextEx(font, FormatText("SCORE: %04i", score), (Vector2){ screenWidth - 300, 20 }, font.baseSize, -2, ORANGE);
|
||||
DrawTextEx(font, FormatText("DISTANCE: %04i", (int)distance), (Vector2){ 550, 20 }, font.baseSize, -2, ORANGE);
|
||||
DrawTextEx(font, FormatText("SCORE: %04i", score), (Vector2){ screenWidth - 300, 20 }, font.baseSize, -2, RL_ORANGE);
|
||||
DrawTextEx(font, FormatText("DISTANCE: %04i", (int)distance), (Vector2){ 550, 20 }, font.baseSize, -2, RL_ORANGE);
|
||||
|
||||
if (gameraMode)
|
||||
{
|
||||
DrawText("GAMERA MODE", 60, 22, 40, GRAY);
|
||||
DrawTexture(gframe, 0, 0, Fade(WHITE, 0.5f));
|
||||
DrawText("GAMERA MODE", 60, 22, 40, RL_GRAY);
|
||||
DrawTexture(gframe, 0, 0, Fade(RL_WHITE, 0.5f));
|
||||
}
|
||||
|
||||
} break;
|
||||
case ENDING:
|
||||
{
|
||||
// Draw a transparent black rectangle that covers all screen
|
||||
DrawRectangle(0, 0, screenWidth, screenHeight, Fade(BLACK, 0.4f));
|
||||
DrawRectangle(0, 0, screenWidth, screenHeight, Fade(RL_BLACK, 0.4f));
|
||||
|
||||
DrawTextEx(font, "GAME OVER", (Vector2){ 300, 160 }, font.baseSize*3, -2, MAROON);
|
||||
DrawTextEx(font, "GAME OVER", (Vector2){ 300, 160 }, font.baseSize*3, -2, RL_MAROON);
|
||||
|
||||
DrawTextEx(font, FormatText("SCORE: %04i", score), (Vector2){ 680, 350 }, font.baseSize, -2, GOLD);
|
||||
DrawTextEx(font, FormatText("DISTANCE: %04i", (int)distance), (Vector2){ 290, 350 }, font.baseSize, -2, GOLD);
|
||||
DrawTextEx(font, FormatText("HISCORE: %04i", hiscore), (Vector2){ 665, 400 }, font.baseSize, -2, ORANGE);
|
||||
DrawTextEx(font, FormatText("HIDISTANCE: %04i", (int)hidistance), (Vector2){ 270, 400 }, font.baseSize, -2, ORANGE);
|
||||
DrawTextEx(font, FormatText("SCORE: %04i", score), (Vector2){ 680, 350 }, font.baseSize, -2, RL_GOLD);
|
||||
DrawTextEx(font, FormatText("DISTANCE: %04i", (int)distance), (Vector2){ 290, 350 }, font.baseSize, -2, RL_GOLD);
|
||||
DrawTextEx(font, FormatText("HISCORE: %04i", hiscore), (Vector2){ 665, 400 }, font.baseSize, -2, RL_ORANGE);
|
||||
DrawTextEx(font, FormatText("HIDISTANCE: %04i", (int)hidistance), (Vector2){ 270, 400 }, font.baseSize, -2, RL_ORANGE);
|
||||
|
||||
// Draw blinking text
|
||||
if ((framesCounter/30) % 2) DrawTextEx(font, "PRESS ENTER to REPLAY", (Vector2){ screenWidth/2 - 250, 520 }, font.baseSize, -2, LIGHTGRAY);
|
||||
if ((framesCounter/30) % 2) DrawTextEx(font, "PRESS ENTER to REPLAY", (Vector2){ screenWidth/2 - 250, 520 }, font.baseSize, -2, RL_LIGHTGRAY);
|
||||
|
||||
} break;
|
||||
default: break;
|
||||
|
|
|
|||
|
|
@ -433,13 +433,13 @@ void UpdateDrawFrame(void)
|
|||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
|
||||
ClearBackground(RAYWHITE);
|
||||
ClearBackground(RL_RAYWHITE);
|
||||
|
||||
// Draw background (common to all screens)
|
||||
DrawTexture(sky, 0, 0, WHITE);
|
||||
DrawTexture(sky, 0, 0, RL_WHITE);
|
||||
|
||||
DrawTexture(mountains, backScrolling, 0, WHITE);
|
||||
DrawTexture(mountains, screenWidth + backScrolling, 0, WHITE);
|
||||
DrawTexture(mountains, backScrolling, 0, RL_WHITE);
|
||||
DrawTexture(mountains, screenWidth + backScrolling, 0, RL_WHITE);
|
||||
|
||||
if (!gameraMode)
|
||||
{
|
||||
|
|
@ -457,24 +457,24 @@ void UpdateDrawFrame(void)
|
|||
case TITLE:
|
||||
{
|
||||
// Draw title
|
||||
DrawTexture(title, screenWidth/2 - title.width/2, screenHeight/2 - title.height/2 - 80, WHITE);
|
||||
DrawTexture(title, screenWidth/2 - title.width/2, screenHeight/2 - title.height/2 - 80, RL_WHITE);
|
||||
|
||||
// Draw blinking text
|
||||
if ((framesCounter/30) % 2) DrawTextEx(font, "PRESS ENTER", (Vector2){ screenWidth/2 - 150, 480 }, font.baseSize, 1, WHITE);
|
||||
if ((framesCounter/30) % 2) DrawTextEx(font, "PRESS ENTER", (Vector2){ screenWidth/2 - 150, 480 }, font.baseSize, 1, RL_WHITE);
|
||||
|
||||
} break;
|
||||
case GAMEPLAY:
|
||||
{
|
||||
// Draw water lines
|
||||
for (int i = 0; i < 5; i++) DrawRectangle(0, i*120 + 120, screenWidth, 110, Fade(SKYBLUE, 0.1f));
|
||||
for (int i = 0; i < 5; i++) DrawRectangle(0, i*120 + 120, screenWidth, 110, Fade(RL_SKYBLUE, 0.1f));
|
||||
|
||||
// Draw player
|
||||
if (!gameraMode) DrawTexture(turtle, playerBounds.x - 14, playerBounds.y - 14, WHITE);
|
||||
else DrawTexture(gamera, playerBounds.x - 64, playerBounds.y - 64, WHITE);
|
||||
if (!gameraMode) DrawTexture(turtle, playerBounds.x - 14, playerBounds.y - 14, RL_WHITE);
|
||||
else DrawTexture(gamera, playerBounds.x - 64, playerBounds.y - 64, RL_WHITE);
|
||||
|
||||
// Draw player bounding box
|
||||
//if (!gameraMode) DrawRectangleRec(playerBounds, Fade(GREEN, 0.4f));
|
||||
//else DrawRectangleRec(playerBounds, Fade(ORANGE, 0.4f));
|
||||
//if (!gameraMode) DrawRectangleRec(playerBounds, Fade(RL_GREEN, 0.4f));
|
||||
//else DrawRectangleRec(playerBounds, Fade(RL_ORANGE, 0.4f));
|
||||
|
||||
// Draw enemies
|
||||
for (int i = 0; i < MAX_ENEMIES; i++)
|
||||
|
|
@ -484,10 +484,10 @@ void UpdateDrawFrame(void)
|
|||
// Draw enemies
|
||||
switch(enemyType[i])
|
||||
{
|
||||
case 0: DrawTexture(shark, enemyBounds[i].x - 14, enemyBounds[i].y - 14, WHITE); break;
|
||||
case 1: DrawTexture(orca, enemyBounds[i].x - 14, enemyBounds[i].y - 14, WHITE); break;
|
||||
case 2: DrawTexture(swhale, enemyBounds[i].x - 14, enemyBounds[i].y - 14, WHITE); break;
|
||||
case 3: DrawTexture(fish, enemyBounds[i].x - 14, enemyBounds[i].y - 14, WHITE); break;
|
||||
case 0: DrawTexture(shark, enemyBounds[i].x - 14, enemyBounds[i].y - 14, RL_WHITE); break;
|
||||
case 1: DrawTexture(orca, enemyBounds[i].x - 14, enemyBounds[i].y - 14, RL_WHITE); break;
|
||||
case 2: DrawTexture(swhale, enemyBounds[i].x - 14, enemyBounds[i].y - 14, RL_WHITE); break;
|
||||
case 3: DrawTexture(fish, enemyBounds[i].x - 14, enemyBounds[i].y - 14, RL_WHITE); break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
|
|
@ -495,10 +495,10 @@ void UpdateDrawFrame(void)
|
|||
/*
|
||||
switch(enemyType[i])
|
||||
{
|
||||
case 0: DrawRectangleRec(enemyBounds[i], Fade(RED, 0.5f)); break;
|
||||
case 1: DrawRectangleRec(enemyBounds[i], Fade(RED, 0.5f)); break;
|
||||
case 2: DrawRectangleRec(enemyBounds[i], Fade(RED, 0.5f)); break;
|
||||
case 3: DrawRectangleRec(enemyBounds[i], Fade(GREEN, 0.5f)); break;
|
||||
case 0: DrawRectangleRec(enemyBounds[i], Fade(RL_RED, 0.5f)); break;
|
||||
case 1: DrawRectangleRec(enemyBounds[i], Fade(RL_RED, 0.5f)); break;
|
||||
case 2: DrawRectangleRec(enemyBounds[i], Fade(RL_RED, 0.5f)); break;
|
||||
case 3: DrawRectangleRec(enemyBounds[i], Fade(RL_GREEN, 0.5f)); break;
|
||||
default: break;
|
||||
}
|
||||
*/
|
||||
|
|
@ -506,34 +506,34 @@ void UpdateDrawFrame(void)
|
|||
}
|
||||
|
||||
// Draw gameplay interface
|
||||
DrawRectangle(20, 20, 400, 40, Fade(GRAY, 0.4f));
|
||||
DrawRectangle(20, 20, foodBar, 40, ORANGE);
|
||||
DrawRectangleLines(20, 20, 400, 40, BLACK);
|
||||
DrawRectangle(20, 20, 400, 40, Fade(RL_GRAY, 0.4f));
|
||||
DrawRectangle(20, 20, foodBar, 40, RL_ORANGE);
|
||||
DrawRectangleLines(20, 20, 400, 40, RL_BLACK);
|
||||
|
||||
DrawTextEx(font, FormatText("SCORE: %04i", score), (Vector2){ screenWidth - 300, 20 }, font.baseSize, -2, ORANGE);
|
||||
DrawTextEx(font, FormatText("DISTANCE: %04i", (int)distance), (Vector2){ 550, 20 }, font.baseSize, -2, ORANGE);
|
||||
DrawTextEx(font, FormatText("SCORE: %04i", score), (Vector2){ screenWidth - 300, 20 }, font.baseSize, -2, RL_ORANGE);
|
||||
DrawTextEx(font, FormatText("DISTANCE: %04i", (int)distance), (Vector2){ 550, 20 }, font.baseSize, -2, RL_ORANGE);
|
||||
|
||||
if (gameraMode)
|
||||
{
|
||||
DrawText("GAMERA MODE", 60, 22, 40, GRAY);
|
||||
DrawTexture(gframe, 0, 0, Fade(WHITE, 0.5f));
|
||||
DrawText("GAMERA MODE", 60, 22, 40, RL_GRAY);
|
||||
DrawTexture(gframe, 0, 0, Fade(RL_WHITE, 0.5f));
|
||||
}
|
||||
|
||||
} break;
|
||||
case ENDING:
|
||||
{
|
||||
// Draw a transparent black rectangle that covers all screen
|
||||
DrawRectangle(0, 0, screenWidth, screenHeight, Fade(BLACK, 0.4f));
|
||||
DrawRectangle(0, 0, screenWidth, screenHeight, Fade(RL_BLACK, 0.4f));
|
||||
|
||||
DrawTextEx(font, "GAME OVER", (Vector2){ 300, 160 }, font.baseSize*3, -2, MAROON);
|
||||
DrawTextEx(font, "GAME OVER", (Vector2){ 300, 160 }, font.baseSize*3, -2, RL_MAROON);
|
||||
|
||||
DrawTextEx(font, FormatText("SCORE: %04i", score), (Vector2){ 680, 350 }, font.baseSize, -2, GOLD);
|
||||
DrawTextEx(font, FormatText("DISTANCE: %04i", (int)distance), (Vector2){ 290, 350 }, font.baseSize, -2, GOLD);
|
||||
DrawTextEx(font, FormatText("HISCORE: %04i", hiscore), (Vector2){ 665, 400 }, font.baseSize, -2, ORANGE);
|
||||
DrawTextEx(font, FormatText("HIDISTANCE: %04i", (int)hidistance), (Vector2){ 270, 400 }, font.baseSize, -2, ORANGE);
|
||||
DrawTextEx(font, FormatText("SCORE: %04i", score), (Vector2){ 680, 350 }, font.baseSize, -2, RL_GOLD);
|
||||
DrawTextEx(font, FormatText("DISTANCE: %04i", (int)distance), (Vector2){ 290, 350 }, font.baseSize, -2, RL_GOLD);
|
||||
DrawTextEx(font, FormatText("HISCORE: %04i", hiscore), (Vector2){ 665, 400 }, font.baseSize, -2, RL_ORANGE);
|
||||
DrawTextEx(font, FormatText("HIDISTANCE: %04i", (int)hidistance), (Vector2){ 270, 400 }, font.baseSize, -2, RL_ORANGE);
|
||||
|
||||
// Draw blinking text
|
||||
if ((framesCounter/30) % 2) DrawTextEx(font, "PRESS ENTER to REPLAY", (Vector2){ screenWidth/2 - 250, 520 }, font.baseSize, -2, LIGHTGRAY);
|
||||
if ((framesCounter/30) % 2) DrawTextEx(font, "PRESS ENTER to REPLAY", (Vector2){ screenWidth/2 - 250, 520 }, font.baseSize, -2, RL_LIGHTGRAY);
|
||||
|
||||
} break;
|
||||
default: break;
|
||||
|
|
|
|||
Loading…
Reference in a new issue