Fixing all other macros by adding RL_ prefix.
This commit is contained in:
parent
8579d1386d
commit
b6cb51e3e8
66 changed files with 1821 additions and 1821 deletions
|
|
@ -281,18 +281,18 @@ void DrawGame(void)
|
|||
{
|
||||
BeginDrawing();
|
||||
|
||||
ClearBackground(RAYWHITE);
|
||||
ClearBackground(RL_RAYWHITE);
|
||||
|
||||
if (!gameOver)
|
||||
{
|
||||
// Draw player bar
|
||||
DrawRectangle(player.position.x - player.size.x/2, player.position.y - player.size.y/2, player.size.x, player.size.y, BLACK);
|
||||
DrawRectangle(player.position.x - player.size.x/2, player.position.y - player.size.y/2, player.size.x, player.size.y, RL_BLACK);
|
||||
|
||||
// Draw player lives
|
||||
for (int i = 0; i < player.life; i++) DrawRectangle(20 + 40*i, screenHeight - 30, 35, 10, LIGHTGRAY);
|
||||
for (int i = 0; i < player.life; i++) DrawRectangle(20 + 40*i, screenHeight - 30, 35, 10, RL_LIGHTGRAY);
|
||||
|
||||
// Draw ball
|
||||
DrawCircleV(ball.position, ball.radius, MAROON);
|
||||
DrawCircleV(ball.position, ball.radius, RL_MAROON);
|
||||
|
||||
// Draw bricks
|
||||
for (int i = 0; i < LINES_OF_BRICKS; i++)
|
||||
|
|
@ -301,15 +301,15 @@ void DrawGame(void)
|
|||
{
|
||||
if (brick[i][j].active)
|
||||
{
|
||||
if ((i + j) % 2 == 0) DrawRectangle(brick[i][j].position.x - brickSize.x/2, brick[i][j].position.y - brickSize.y/2, brickSize.x, brickSize.y, GRAY);
|
||||
else DrawRectangle(brick[i][j].position.x - brickSize.x/2, brick[i][j].position.y - brickSize.y/2, brickSize.x, brickSize.y, DARKGRAY);
|
||||
if ((i + j) % 2 == 0) DrawRectangle(brick[i][j].position.x - brickSize.x/2, brick[i][j].position.y - brickSize.y/2, brickSize.x, brickSize.y, RL_GRAY);
|
||||
else DrawRectangle(brick[i][j].position.x - brickSize.x/2, brick[i][j].position.y - brickSize.y/2, brickSize.x, brickSize.y, RL_DARKGRAY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (pause) DrawText("GAME PAUSED", screenWidth/2 - MeasureText("GAME PAUSED", 40)/2, screenHeight/2 - 40, 40, GRAY);
|
||||
if (pause) DrawText("GAME PAUSED", screenWidth/2 - MeasureText("GAME PAUSED", 40)/2, screenHeight/2 - 40, 40, RL_GRAY);
|
||||
}
|
||||
else DrawText("PRESS [ENTER] TO PLAY AGAIN", GetScreenWidth()/2 - MeasureText("PRESS [ENTER] TO PLAY AGAIN", 20)/2, GetScreenHeight()/2 - 50, 20, GRAY);
|
||||
else DrawText("PRESS [ENTER] TO PLAY AGAIN", GetScreenWidth()/2 - MeasureText("PRESS [ENTER] TO PLAY AGAIN", 20)/2, GetScreenHeight()/2 - 50, 20, RL_GRAY);
|
||||
|
||||
EndDrawing();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ void InitGame(void)
|
|||
player.acceleration = 0;
|
||||
player.rotation = 0;
|
||||
player.collider = (Vector3){player.position.x + sin(player.rotation*RL_DEG2RAD)*(shipHeight/2.5f), player.position.y - cos(player.rotation*RL_DEG2RAD)*(shipHeight/2.5f), 12};
|
||||
player.color = LIGHTGRAY;
|
||||
player.color = RL_LIGHTGRAY;
|
||||
|
||||
destroyedMeteorsCount = 0;
|
||||
|
||||
|
|
@ -165,7 +165,7 @@ void InitGame(void)
|
|||
shoot[i].radius = 2;
|
||||
shoot[i].active = false;
|
||||
shoot[i].lifeSpawn = 0;
|
||||
shoot[i].color = WHITE;
|
||||
shoot[i].color = RL_WHITE;
|
||||
}
|
||||
|
||||
for (int i = 0; i < MAX_BIG_METEORS; i++)
|
||||
|
|
@ -207,7 +207,7 @@ void InitGame(void)
|
|||
bigMeteor[i].speed = (Vector2){velx, vely};
|
||||
bigMeteor[i].radius = 40;
|
||||
bigMeteor[i].active = true;
|
||||
bigMeteor[i].color = BLUE;
|
||||
bigMeteor[i].color = RL_BLUE;
|
||||
}
|
||||
|
||||
for (int i = 0; i < MAX_MEDIUM_METEORS; i++)
|
||||
|
|
@ -216,7 +216,7 @@ void InitGame(void)
|
|||
mediumMeteor[i].speed = (Vector2){0,0};
|
||||
mediumMeteor[i].radius = 20;
|
||||
mediumMeteor[i].active = false;
|
||||
mediumMeteor[i].color = BLUE;
|
||||
mediumMeteor[i].color = RL_BLUE;
|
||||
}
|
||||
|
||||
for (int i = 0; i < MAX_SMALL_METEORS; i++)
|
||||
|
|
@ -225,7 +225,7 @@ void InitGame(void)
|
|||
smallMeteor[i].speed = (Vector2){0,0};
|
||||
smallMeteor[i].radius = 10;
|
||||
smallMeteor[i].active = false;
|
||||
smallMeteor[i].color = BLUE;
|
||||
smallMeteor[i].color = RL_BLUE;
|
||||
}
|
||||
|
||||
midMeteorsCount = 0;
|
||||
|
|
@ -440,7 +440,7 @@ void UpdateGame(void)
|
|||
midMeteorsCount ++;
|
||||
}
|
||||
//bigMeteor[a].position = (Vector2){-100, -100};
|
||||
bigMeteor[a].color = RED;
|
||||
bigMeteor[a].color = RL_RED;
|
||||
a = MAX_BIG_METEORS;
|
||||
}
|
||||
}
|
||||
|
|
@ -471,7 +471,7 @@ void UpdateGame(void)
|
|||
smallMeteorsCount ++;
|
||||
}
|
||||
//mediumMeteor[b].position = (Vector2){-100, -100};
|
||||
mediumMeteor[b].color = GREEN;
|
||||
mediumMeteor[b].color = RL_GREEN;
|
||||
b = MAX_MEDIUM_METEORS;
|
||||
}
|
||||
}
|
||||
|
|
@ -484,7 +484,7 @@ void UpdateGame(void)
|
|||
shoot[i].lifeSpawn = 0;
|
||||
smallMeteor[c].active = false;
|
||||
destroyedMeteorsCount++;
|
||||
smallMeteor[c].color = YELLOW;
|
||||
smallMeteor[c].color = RL_YELLOW;
|
||||
// smallMeteor[c].position = (Vector2){-100, -100};
|
||||
c = MAX_SMALL_METEORS;
|
||||
}
|
||||
|
|
@ -510,7 +510,7 @@ void DrawGame(void)
|
|||
{
|
||||
BeginDrawing();
|
||||
|
||||
ClearBackground(RAYWHITE);
|
||||
ClearBackground(RL_RAYWHITE);
|
||||
|
||||
if (!gameOver)
|
||||
{
|
||||
|
|
@ -518,38 +518,38 @@ void DrawGame(void)
|
|||
Vector2 v1 = { player.position.x + sinf(player.rotation*RL_DEG2RAD)*(shipHeight), player.position.y - cosf(player.rotation*RL_DEG2RAD)*(shipHeight) };
|
||||
Vector2 v2 = { player.position.x - cosf(player.rotation*RL_DEG2RAD)*(PLAYER_BASE_SIZE/2), player.position.y - sinf(player.rotation*RL_DEG2RAD)*(PLAYER_BASE_SIZE/2) };
|
||||
Vector2 v3 = { player.position.x + cosf(player.rotation*RL_DEG2RAD)*(PLAYER_BASE_SIZE/2), player.position.y + sinf(player.rotation*RL_DEG2RAD)*(PLAYER_BASE_SIZE/2) };
|
||||
DrawTriangle(v1, v2, v3, MAROON);
|
||||
DrawTriangle(v1, v2, v3, RL_MAROON);
|
||||
|
||||
// Draw meteors
|
||||
for (int i = 0; i < MAX_BIG_METEORS; i++)
|
||||
{
|
||||
if (bigMeteor[i].active) DrawCircleV(bigMeteor[i].position, bigMeteor[i].radius, DARKGRAY);
|
||||
else DrawCircleV(bigMeteor[i].position, bigMeteor[i].radius, Fade(LIGHTGRAY, 0.3f));
|
||||
if (bigMeteor[i].active) DrawCircleV(bigMeteor[i].position, bigMeteor[i].radius, RL_DARKGRAY);
|
||||
else DrawCircleV(bigMeteor[i].position, bigMeteor[i].radius, Fade(RL_LIGHTGRAY, 0.3f));
|
||||
}
|
||||
|
||||
for (int i = 0; i < MAX_MEDIUM_METEORS; i++)
|
||||
{
|
||||
if (mediumMeteor[i].active) DrawCircleV(mediumMeteor[i].position, mediumMeteor[i].radius, GRAY);
|
||||
else DrawCircleV(mediumMeteor[i].position, mediumMeteor[i].radius, Fade(LIGHTGRAY, 0.3f));
|
||||
if (mediumMeteor[i].active) DrawCircleV(mediumMeteor[i].position, mediumMeteor[i].radius, RL_GRAY);
|
||||
else DrawCircleV(mediumMeteor[i].position, mediumMeteor[i].radius, Fade(RL_LIGHTGRAY, 0.3f));
|
||||
}
|
||||
|
||||
for (int i = 0; i < MAX_SMALL_METEORS; i++)
|
||||
{
|
||||
if (smallMeteor[i].active) DrawCircleV(smallMeteor[i].position, smallMeteor[i].radius, GRAY);
|
||||
else DrawCircleV(smallMeteor[i].position, smallMeteor[i].radius, Fade(LIGHTGRAY, 0.3f));
|
||||
if (smallMeteor[i].active) DrawCircleV(smallMeteor[i].position, smallMeteor[i].radius, RL_GRAY);
|
||||
else DrawCircleV(smallMeteor[i].position, smallMeteor[i].radius, Fade(RL_LIGHTGRAY, 0.3f));
|
||||
}
|
||||
|
||||
// Draw shoot
|
||||
for (int i = 0; i < PLAYER_MAX_SHOOTS; i++)
|
||||
{
|
||||
if (shoot[i].active) DrawCircleV(shoot[i].position, shoot[i].radius, BLACK);
|
||||
if (shoot[i].active) DrawCircleV(shoot[i].position, shoot[i].radius, RL_BLACK);
|
||||
}
|
||||
|
||||
if (victory) DrawText("VICTORY", screenWidth/2 - MeasureText("VICTORY", 20)/2, screenHeight/2, 20, LIGHTGRAY);
|
||||
if (victory) DrawText("VICTORY", screenWidth/2 - MeasureText("VICTORY", 20)/2, screenHeight/2, 20, RL_LIGHTGRAY);
|
||||
|
||||
if (pause) DrawText("GAME PAUSED", screenWidth/2 - MeasureText("GAME PAUSED", 40)/2, screenHeight/2 - 40, 40, GRAY);
|
||||
if (pause) DrawText("GAME PAUSED", screenWidth/2 - MeasureText("GAME PAUSED", 40)/2, screenHeight/2 - 40, 40, RL_GRAY);
|
||||
}
|
||||
else DrawText("PRESS [ENTER] TO PLAY AGAIN", GetScreenWidth()/2 - MeasureText("PRESS [ENTER] TO PLAY AGAIN", 20)/2, GetScreenHeight()/2 - 50, 20, GRAY);
|
||||
else DrawText("PRESS [ENTER] TO PLAY AGAIN", GetScreenWidth()/2 - MeasureText("PRESS [ENTER] TO PLAY AGAIN", 20)/2, GetScreenHeight()/2 - 50, 20, RL_GRAY);
|
||||
|
||||
EndDrawing();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ void InitGame(void)
|
|||
player.acceleration = 0;
|
||||
player.rotation = 0;
|
||||
player.collider = (Vector3){player.position.x + sin(player.rotation*RL_DEG2RAD)*(shipHeight/2.5f), player.position.y - cos(player.rotation*RL_DEG2RAD)*(shipHeight/2.5f), 12};
|
||||
player.color = LIGHTGRAY;
|
||||
player.color = RL_LIGHTGRAY;
|
||||
|
||||
for (int i = 0; i < MAX_MEDIUM_METEORS; i++)
|
||||
{
|
||||
|
|
@ -177,7 +177,7 @@ void InitGame(void)
|
|||
mediumMeteor[i].speed = (Vector2){velx, vely};
|
||||
mediumMeteor[i].radius = 20;
|
||||
mediumMeteor[i].active = true;
|
||||
mediumMeteor[i].color = GREEN;
|
||||
mediumMeteor[i].color = RL_GREEN;
|
||||
}
|
||||
|
||||
for (int i = 0; i < MAX_SMALL_METEORS; i++)
|
||||
|
|
@ -217,7 +217,7 @@ void InitGame(void)
|
|||
smallMeteor[i].speed = (Vector2){velx, vely};
|
||||
smallMeteor[i].radius = 10;
|
||||
smallMeteor[i].active = true;
|
||||
smallMeteor[i].color = YELLOW;
|
||||
smallMeteor[i].color = RL_YELLOW;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -331,7 +331,7 @@ void DrawGame(void)
|
|||
{
|
||||
BeginDrawing();
|
||||
|
||||
ClearBackground(RAYWHITE);
|
||||
ClearBackground(RL_RAYWHITE);
|
||||
|
||||
if (!gameOver)
|
||||
{
|
||||
|
|
@ -339,26 +339,26 @@ void DrawGame(void)
|
|||
Vector2 v1 = { player.position.x + sinf(player.rotation*RL_DEG2RAD)*(shipHeight), player.position.y - cosf(player.rotation*RL_DEG2RAD)*(shipHeight) };
|
||||
Vector2 v2 = { player.position.x - cosf(player.rotation*RL_DEG2RAD)*(PLAYER_BASE_SIZE/2), player.position.y - sinf(player.rotation*RL_DEG2RAD)*(PLAYER_BASE_SIZE/2) };
|
||||
Vector2 v3 = { player.position.x + cosf(player.rotation*RL_DEG2RAD)*(PLAYER_BASE_SIZE/2), player.position.y + sinf(player.rotation*RL_DEG2RAD)*(PLAYER_BASE_SIZE/2) };
|
||||
DrawTriangle(v1, v2, v3, MAROON);
|
||||
DrawTriangle(v1, v2, v3, RL_MAROON);
|
||||
|
||||
// Draw meteor
|
||||
for (int i = 0;i < MAX_MEDIUM_METEORS; i++)
|
||||
{
|
||||
if (mediumMeteor[i].active) DrawCircleV(mediumMeteor[i].position, mediumMeteor[i].radius, GRAY);
|
||||
else DrawCircleV(mediumMeteor[i].position, mediumMeteor[i].radius, Fade(LIGHTGRAY, 0.3f));
|
||||
if (mediumMeteor[i].active) DrawCircleV(mediumMeteor[i].position, mediumMeteor[i].radius, RL_GRAY);
|
||||
else DrawCircleV(mediumMeteor[i].position, mediumMeteor[i].radius, Fade(RL_LIGHTGRAY, 0.3f));
|
||||
}
|
||||
|
||||
for (int i = 0;i < MAX_SMALL_METEORS; i++)
|
||||
{
|
||||
if (smallMeteor[i].active) DrawCircleV(smallMeteor[i].position, smallMeteor[i].radius, DARKGRAY);
|
||||
else DrawCircleV(smallMeteor[i].position, smallMeteor[i].radius, Fade(LIGHTGRAY, 0.3f));
|
||||
if (smallMeteor[i].active) DrawCircleV(smallMeteor[i].position, smallMeteor[i].radius, RL_DARKGRAY);
|
||||
else DrawCircleV(smallMeteor[i].position, smallMeteor[i].radius, Fade(RL_LIGHTGRAY, 0.3f));
|
||||
}
|
||||
|
||||
DrawText(FormatText("TIME: %.02f", (float)framesCounter/60), 10, 10, 20, BLACK);
|
||||
DrawText(FormatText("TIME: %.02f", (float)framesCounter/60), 10, 10, 20, RL_BLACK);
|
||||
|
||||
if (pause) DrawText("GAME PAUSED", screenWidth/2 - MeasureText("GAME PAUSED", 40)/2, screenHeight/2 - 40, 40, GRAY);
|
||||
if (pause) DrawText("GAME PAUSED", screenWidth/2 - MeasureText("GAME PAUSED", 40)/2, screenHeight/2 - 40, 40, RL_GRAY);
|
||||
}
|
||||
else DrawText("PRESS [ENTER] TO PLAY AGAIN", GetScreenWidth()/2 - MeasureText("PRESS [ENTER] TO PLAY AGAIN", 20)/2, GetScreenHeight()/2 - 50, 20, GRAY);
|
||||
else DrawText("PRESS [ENTER] TO PLAY AGAIN", GetScreenWidth()/2 - MeasureText("PRESS [ENTER] TO PLAY AGAIN", 20)/2, GetScreenHeight()/2 - 50, 20, RL_GRAY);
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -196,32 +196,32 @@ void DrawGame(void)
|
|||
{
|
||||
BeginDrawing();
|
||||
|
||||
ClearBackground(RAYWHITE);
|
||||
ClearBackground(RL_RAYWHITE);
|
||||
|
||||
if (!gameOver)
|
||||
{
|
||||
DrawCircle(floppy.position.x, floppy.position.y, floppy.radius, DARKGRAY);
|
||||
DrawCircle(floppy.position.x, floppy.position.y, floppy.radius, RL_DARKGRAY);
|
||||
|
||||
// Draw tubes
|
||||
for (int i = 0; i < MAX_TUBES; i++)
|
||||
{
|
||||
DrawRectangle(tubes[i*2].rec.x, tubes[i*2].rec.y, tubes[i*2].rec.width, tubes[i*2].rec.height, GRAY);
|
||||
DrawRectangle(tubes[i*2 + 1].rec.x, tubes[i*2 + 1].rec.y, tubes[i*2 + 1].rec.width, tubes[i*2 + 1].rec.height, GRAY);
|
||||
DrawRectangle(tubes[i*2].rec.x, tubes[i*2].rec.y, tubes[i*2].rec.width, tubes[i*2].rec.height, RL_GRAY);
|
||||
DrawRectangle(tubes[i*2 + 1].rec.x, tubes[i*2 + 1].rec.y, tubes[i*2 + 1].rec.width, tubes[i*2 + 1].rec.height, RL_GRAY);
|
||||
}
|
||||
|
||||
// Draw flashing fx (one frame only)
|
||||
if (superfx)
|
||||
{
|
||||
DrawRectangle(0, 0, screenWidth, screenHeight, WHITE);
|
||||
DrawRectangle(0, 0, screenWidth, screenHeight, RL_WHITE);
|
||||
superfx = false;
|
||||
}
|
||||
|
||||
DrawText(FormatText("%04i", score), 20, 20, 40, GRAY);
|
||||
DrawText(FormatText("HI-SCORE: %04i", hiScore), 20, 70, 20, LIGHTGRAY);
|
||||
DrawText(FormatText("%04i", score), 20, 20, 40, RL_GRAY);
|
||||
DrawText(FormatText("HI-SCORE: %04i", hiScore), 20, 70, 20, RL_LIGHTGRAY);
|
||||
|
||||
if (pause) DrawText("GAME PAUSED", screenWidth/2 - MeasureText("GAME PAUSED", 40)/2, screenHeight/2 - 40, 40, GRAY);
|
||||
if (pause) DrawText("GAME PAUSED", screenWidth/2 - MeasureText("GAME PAUSED", 40)/2, screenHeight/2 - 40, 40, RL_GRAY);
|
||||
}
|
||||
else DrawText("PRESS [ENTER] TO PLAY AGAIN", GetScreenWidth()/2 - MeasureText("PRESS [ENTER] TO PLAY AGAIN", 20)/2, GetScreenHeight()/2 - 50, 20, GRAY);
|
||||
else DrawText("PRESS [ENTER] TO PLAY AGAIN", GetScreenWidth()/2 - MeasureText("PRESS [ENTER] TO PLAY AGAIN", 20)/2, GetScreenHeight()/2 - 50, 20, RL_GRAY);
|
||||
|
||||
EndDrawing();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -239,30 +239,30 @@ void DrawGame(void)
|
|||
{
|
||||
BeginDrawing();
|
||||
|
||||
ClearBackground(RAYWHITE);
|
||||
ClearBackground(RL_RAYWHITE);
|
||||
|
||||
if (!gameOver)
|
||||
{
|
||||
if (follow)
|
||||
{
|
||||
DrawRectangle(0, 0, screenWidth, screenHeight, RED);
|
||||
DrawRectangle(10, 10, screenWidth - 20, screenHeight - 20, RAYWHITE);
|
||||
DrawRectangle(0, 0, screenWidth, screenHeight, RL_RED);
|
||||
DrawRectangle(10, 10, screenWidth - 20, screenHeight - 20, RL_RAYWHITE);
|
||||
}
|
||||
|
||||
DrawRectangleLines(home.rec.x, home.rec.y, home.rec.width, home.rec.height, BLUE);
|
||||
DrawRectangleLines(home.rec.x, home.rec.y, home.rec.width, home.rec.height, RL_BLUE);
|
||||
|
||||
DrawCircleLines(enemy.position.x, enemy.position.y, enemy.radiusBounds, RED);
|
||||
DrawCircleV(enemy.position, enemy.radius, MAROON);
|
||||
DrawCircleLines(enemy.position.x, enemy.position.y, enemy.radiusBounds, RL_RED);
|
||||
DrawCircleV(enemy.position, enemy.radius, RL_MAROON);
|
||||
|
||||
DrawCircleV(player.position, player.radius, GRAY);
|
||||
if (points.active) DrawCircleV(points.position, points.radius, GOLD);
|
||||
DrawCircleV(player.position, player.radius, RL_GRAY);
|
||||
if (points.active) DrawCircleV(points.position, points.radius, RL_GOLD);
|
||||
|
||||
DrawText(FormatText("SCORE: %04i", score), 20, 15, 20, GRAY);
|
||||
DrawText(FormatText("HI-SCORE: %04i", hiScore), 300, 15, 20, GRAY);
|
||||
DrawText(FormatText("SCORE: %04i", score), 20, 15, 20, RL_GRAY);
|
||||
DrawText(FormatText("HI-SCORE: %04i", hiScore), 300, 15, 20, RL_GRAY);
|
||||
|
||||
if (pause) DrawText("GAME PAUSED", screenWidth/2 - MeasureText("GAME PAUSED", 40)/2, screenHeight/2 - 40, 40, GRAY);
|
||||
if (pause) DrawText("GAME PAUSED", screenWidth/2 - MeasureText("GAME PAUSED", 40)/2, screenHeight/2 - 40, 40, RL_GRAY);
|
||||
}
|
||||
else DrawText("PRESS [ENTER] TO PLAY AGAIN", GetScreenWidth()/2 - MeasureText("PRESS [ENTER] TO PLAY AGAIN", 20)/2, GetScreenHeight()/2 - 50, 20, GRAY);
|
||||
else DrawText("PRESS [ENTER] TO PLAY AGAIN", GetScreenWidth()/2 - MeasureText("PRESS [ENTER] TO PLAY AGAIN", 20)/2, GetScreenHeight()/2 - 50, 20, RL_GRAY);
|
||||
|
||||
EndDrawing();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -237,7 +237,7 @@ void DrawGame(void)
|
|||
{
|
||||
BeginDrawing();
|
||||
|
||||
ClearBackground(RAYWHITE);
|
||||
ClearBackground(RL_RAYWHITE);
|
||||
|
||||
if (!gameOver)
|
||||
{
|
||||
|
|
@ -247,7 +247,7 @@ void DrawGame(void)
|
|||
// Draw explosions
|
||||
for (int i = 0; i < MAX_EXPLOSIONS; i++)
|
||||
{
|
||||
if (explosion[i].active) DrawCircle(explosion[i].position.x, explosion[i].position.y, explosion[i].radius, RAYWHITE);
|
||||
if (explosion[i].active) DrawCircle(explosion[i].position.x, explosion[i].position.y, explosion[i].radius, RL_RAYWHITE);
|
||||
}
|
||||
|
||||
// Draw players
|
||||
|
|
@ -256,14 +256,14 @@ void DrawGame(void)
|
|||
if (player[i].isAlive)
|
||||
{
|
||||
if (player[i].isLeftTeam) DrawRectangle(player[i].position.x - player[i].size.x/2, player[i].position.y - player[i].size.y/2,
|
||||
player[i].size.x, player[i].size.y, BLUE);
|
||||
player[i].size.x, player[i].size.y, RL_BLUE);
|
||||
else DrawRectangle(player[i].position.x - player[i].size.x/2, player[i].position.y - player[i].size.y/2,
|
||||
player[i].size.x, player[i].size.y, RED);
|
||||
player[i].size.x, player[i].size.y, RL_RED);
|
||||
}
|
||||
}
|
||||
|
||||
// Draw ball
|
||||
if (ball.active) DrawCircle(ball.position.x, ball.position.y, ball.radius, MAROON);
|
||||
if (ball.active) DrawCircle(ball.position.x, ball.position.y, ball.radius, RL_MAROON);
|
||||
|
||||
// Draw the angle and the power of the aim, and the previous ones
|
||||
if (!ballOnAir)
|
||||
|
|
@ -272,21 +272,21 @@ void DrawGame(void)
|
|||
/*
|
||||
if (player[playerTurn].isLeftTeam)
|
||||
{
|
||||
DrawText(FormatText("Previous Point %i, %i", (int)player[playerTurn].previousPoint.x, (int)player[playerTurn].previousPoint.y), 20, 20, 20, DARKBLUE);
|
||||
DrawText(FormatText("Previous Angle %i", player[playerTurn].previousAngle), 20, 50, 20, DARKBLUE);
|
||||
DrawText(FormatText("Previous Power %i", player[playerTurn].previousPower), 20, 80, 20, DARKBLUE);
|
||||
DrawText(FormatText("Aiming Point %i, %i", (int)player[playerTurn].aimingPoint.x, (int)player[playerTurn].aimingPoint.y), 20, 110, 20, DARKBLUE);
|
||||
DrawText(FormatText("Aiming Angle %i", player[playerTurn].aimingAngle), 20, 140, 20, DARKBLUE);
|
||||
DrawText(FormatText("Aiming Power %i", player[playerTurn].aimingPower), 20, 170, 20, DARKBLUE);
|
||||
DrawText(FormatText("Previous Point %i, %i", (int)player[playerTurn].previousPoint.x, (int)player[playerTurn].previousPoint.y), 20, 20, 20, RL_DARKBLUE);
|
||||
DrawText(FormatText("Previous Angle %i", player[playerTurn].previousAngle), 20, 50, 20, RL_DARKBLUE);
|
||||
DrawText(FormatText("Previous Power %i", player[playerTurn].previousPower), 20, 80, 20, RL_DARKBLUE);
|
||||
DrawText(FormatText("Aiming Point %i, %i", (int)player[playerTurn].aimingPoint.x, (int)player[playerTurn].aimingPoint.y), 20, 110, 20, RL_DARKBLUE);
|
||||
DrawText(FormatText("Aiming Angle %i", player[playerTurn].aimingAngle), 20, 140, 20, RL_DARKBLUE);
|
||||
DrawText(FormatText("Aiming Power %i", player[playerTurn].aimingPower), 20, 170, 20, RL_DARKBLUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
DrawText(FormatText("Previous Point %i, %i", (int)player[playerTurn].previousPoint.x, (int)player[playerTurn].previousPoint.y), screenWidth*3/4, 20, 20, DARKBLUE);
|
||||
DrawText(FormatText("Previous Angle %i", player[playerTurn].previousAngle), screenWidth*3/4, 50, 20, DARKBLUE);
|
||||
DrawText(FormatText("Previous Power %i", player[playerTurn].previousPower), screenWidth*3/4, 80, 20, DARKBLUE);
|
||||
DrawText(FormatText("Aiming Point %i, %i", (int)player[playerTurn].aimingPoint.x, (int)player[playerTurn].aimingPoint.y), screenWidth*3/4, 110, 20, DARKBLUE);
|
||||
DrawText(FormatText("Aiming Angle %i", player[playerTurn].aimingAngle), screenWidth*3/4, 140, 20, DARKBLUE);
|
||||
DrawText(FormatText("Aiming Power %i", player[playerTurn].aimingPower), screenWidth*3/4, 170, 20, DARKBLUE);
|
||||
DrawText(FormatText("Previous Point %i, %i", (int)player[playerTurn].previousPoint.x, (int)player[playerTurn].previousPoint.y), screenWidth*3/4, 20, 20, RL_DARKBLUE);
|
||||
DrawText(FormatText("Previous Angle %i", player[playerTurn].previousAngle), screenWidth*3/4, 50, 20, RL_DARKBLUE);
|
||||
DrawText(FormatText("Previous Power %i", player[playerTurn].previousPower), screenWidth*3/4, 80, 20, RL_DARKBLUE);
|
||||
DrawText(FormatText("Aiming Point %i, %i", (int)player[playerTurn].aimingPoint.x, (int)player[playerTurn].aimingPoint.y), screenWidth*3/4, 110, 20, RL_DARKBLUE);
|
||||
DrawText(FormatText("Aiming Angle %i", player[playerTurn].aimingAngle), screenWidth*3/4, 140, 20, RL_DARKBLUE);
|
||||
DrawText(FormatText("Aiming Power %i", player[playerTurn].aimingPower), screenWidth*3/4, 170, 20, RL_DARKBLUE);
|
||||
}
|
||||
*/
|
||||
|
||||
|
|
@ -296,30 +296,30 @@ void DrawGame(void)
|
|||
// Previous aiming
|
||||
DrawTriangle((Vector2){ player[playerTurn].position.x - player[playerTurn].size.x/4, player[playerTurn].position.y - player[playerTurn].size.y/4 },
|
||||
(Vector2){ player[playerTurn].position.x + player[playerTurn].size.x/4, player[playerTurn].position.y + player[playerTurn].size.y/4 },
|
||||
player[playerTurn].previousPoint, GRAY);
|
||||
player[playerTurn].previousPoint, RL_GRAY);
|
||||
|
||||
// Actual aiming
|
||||
DrawTriangle((Vector2){ player[playerTurn].position.x - player[playerTurn].size.x/4, player[playerTurn].position.y - player[playerTurn].size.y/4 },
|
||||
(Vector2){ player[playerTurn].position.x + player[playerTurn].size.x/4, player[playerTurn].position.y + player[playerTurn].size.y/4 },
|
||||
player[playerTurn].aimingPoint, DARKBLUE);
|
||||
player[playerTurn].aimingPoint, RL_DARKBLUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Previous aiming
|
||||
DrawTriangle((Vector2){ player[playerTurn].position.x - player[playerTurn].size.x/4, player[playerTurn].position.y + player[playerTurn].size.y/4 },
|
||||
(Vector2){ player[playerTurn].position.x + player[playerTurn].size.x/4, player[playerTurn].position.y - player[playerTurn].size.y/4 },
|
||||
player[playerTurn].previousPoint, GRAY);
|
||||
player[playerTurn].previousPoint, RL_GRAY);
|
||||
|
||||
// Actual aiming
|
||||
DrawTriangle((Vector2){ player[playerTurn].position.x - player[playerTurn].size.x/4, player[playerTurn].position.y + player[playerTurn].size.y/4 },
|
||||
(Vector2){ player[playerTurn].position.x + player[playerTurn].size.x/4, player[playerTurn].position.y - player[playerTurn].size.y/4 },
|
||||
player[playerTurn].aimingPoint, MAROON);
|
||||
player[playerTurn].aimingPoint, RL_MAROON);
|
||||
}
|
||||
}
|
||||
|
||||
if (pause) DrawText("GAME PAUSED", screenWidth/2 - MeasureText("GAME PAUSED", 40)/2, screenHeight/2 - 40, 40, GRAY);
|
||||
if (pause) DrawText("GAME PAUSED", screenWidth/2 - MeasureText("GAME PAUSED", 40)/2, screenHeight/2 - 40, 40, RL_GRAY);
|
||||
}
|
||||
else DrawText("PRESS [ENTER] TO PLAY AGAIN", GetScreenWidth()/2 - MeasureText("PRESS [ENTER] TO PLAY AGAIN", 20)/2, GetScreenHeight()/2 - 50, 20, GRAY);
|
||||
else DrawText("PRESS [ENTER] TO PLAY AGAIN", GetScreenWidth()/2 - MeasureText("PRESS [ENTER] TO PLAY AGAIN", 20)/2, GetScreenHeight()/2 - 50, 20, RL_GRAY);
|
||||
|
||||
EndDrawing();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ void UpdateTransition(void)
|
|||
|
||||
void DrawTransition(void)
|
||||
{
|
||||
DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), Fade(RAYWHITE, transAlpha));
|
||||
DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), Fade(RL_RAYWHITE, transAlpha));
|
||||
}
|
||||
|
||||
void UpdateDrawFrame(void)
|
||||
|
|
@ -335,7 +335,7 @@ void UpdateDrawFrame(void)
|
|||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
|
||||
ClearBackground(RAYWHITE);
|
||||
ClearBackground(RL_RAYWHITE);
|
||||
|
||||
switch(currentScreen)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -124,26 +124,26 @@ void UpdateLevel00Screen(void)
|
|||
void DrawLevel00Screen(void)
|
||||
{
|
||||
// Draw Level00 screen
|
||||
DrawText("U", boundsU.x, boundsU.y + 10, 160, GRAY);
|
||||
DrawText("J", GetScreenWidth()/2 - MeasureText("JUST DO", 160)/2, GetScreenHeight()/2 - 80, 160, GRAY);
|
||||
DrawText("ST D", GetScreenWidth()/2 - MeasureText("JUST DO", 160)/2 + 210, GetScreenHeight()/2 - 80, 160, GRAY);
|
||||
DrawText("O", boundsO.x, boundsO.y + 10, 160, GRAY);
|
||||
DrawText("U", boundsU.x, boundsU.y + 10, 160, RL_GRAY);
|
||||
DrawText("J", GetScreenWidth()/2 - MeasureText("JUST DO", 160)/2, GetScreenHeight()/2 - 80, 160, RL_GRAY);
|
||||
DrawText("ST D", GetScreenWidth()/2 - MeasureText("JUST DO", 160)/2 + 210, GetScreenHeight()/2 - 80, 160, RL_GRAY);
|
||||
DrawText("O", boundsO.x, boundsO.y + 10, 160, RL_GRAY);
|
||||
|
||||
DrawText("by RAMON SANTAMARIA (@raysan5)", 370, GetScreenHeight()/2 + 100, 30, Fade(LIGHTGRAY, 0.4f));
|
||||
DrawText("by RAMON SANTAMARIA (@raysan5)", 370, GetScreenHeight()/2 + 100, 30, Fade(RL_LIGHTGRAY, 0.4f));
|
||||
|
||||
if (mouseOverU && !placedU) DrawRectangleLines(boundsU.x - 20, boundsU.y, boundsU.width, boundsU.height, Fade(LIGHTGRAY, 0.8f));
|
||||
//DrawRectangleBordersRec(boundsU, -20, 0, 20, Fade(RED, 0.3f));
|
||||
if (mouseOverU && !placedU) DrawRectangleLines(boundsU.x - 20, boundsU.y, boundsU.width, boundsU.height, Fade(RL_LIGHTGRAY, 0.8f));
|
||||
//DrawRectangleBordersRec(boundsU, -20, 0, 20, Fade(RL_RED, 0.3f));
|
||||
|
||||
if (mouseOverO && !placedO) DrawRectangleLines(boundsO.x - 20, boundsO.y, boundsO.width, boundsO.height, Fade(LIGHTGRAY, 0.8f));
|
||||
//DrawRectangleBordersRec(boundsO, -20, 0, 20, Fade(RED, 0.3f));
|
||||
if (mouseOverO && !placedO) DrawRectangleLines(boundsO.x - 20, boundsO.y, boundsO.width, boundsO.height, Fade(RL_LIGHTGRAY, 0.8f));
|
||||
//DrawRectangleBordersRec(boundsO, -20, 0, 20, Fade(RL_RED, 0.3f));
|
||||
|
||||
if (levelFinished)
|
||||
{
|
||||
DrawRectangleBordersRec((Rectangle){0, 0, GetScreenWidth(), GetScreenHeight()}, 0, 0, 60, Fade(LIGHTGRAY, 0.6f));
|
||||
DrawText("LEVEL 00", GetScreenWidth()/2 - MeasureText("LEVEL 00", 30)/2, 20, 30, GRAY);
|
||||
DrawText(FormatText("DONE! (Seconds: %03i)", levelTimeSec), GetScreenWidth()/2 - MeasureText("DONE! (Seconds: 000)", 30)/2, GetScreenHeight() - 40, 30, GRAY);
|
||||
DrawRectangleBordersRec((Rectangle){0, 0, GetScreenWidth(), GetScreenHeight()}, 0, 0, 60, Fade(RL_LIGHTGRAY, 0.6f));
|
||||
DrawText("LEVEL 00", GetScreenWidth()/2 - MeasureText("LEVEL 00", 30)/2, 20, 30, RL_GRAY);
|
||||
DrawText(FormatText("DONE! (Seconds: %03i)", levelTimeSec), GetScreenWidth()/2 - MeasureText("DONE! (Seconds: 000)", 30)/2, GetScreenHeight() - 40, 30, RL_GRAY);
|
||||
}
|
||||
else DrawText("LEVEL 00", GetScreenWidth()/2 - MeasureText("LEVEL 00", 30)/2, 20, 30, LIGHTGRAY);
|
||||
else DrawText("LEVEL 00", GetScreenWidth()/2 - MeasureText("LEVEL 00", 30)/2, 20, 30, RL_LIGHTGRAY);
|
||||
}
|
||||
|
||||
// Level00 Screen Unload logic
|
||||
|
|
|
|||
|
|
@ -133,21 +133,21 @@ void UpdateLevel01Screen(void)
|
|||
void DrawLevel01Screen(void)
|
||||
{
|
||||
// Draw Level01 screen
|
||||
if (!levelFinished) DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), LIGHTGRAY);
|
||||
else DrawRectangle(60, 60, GetScreenWidth() - 120, GetScreenHeight() - 120, LIGHTGRAY);
|
||||
if (!levelFinished) DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), RL_LIGHTGRAY);
|
||||
else DrawRectangle(60, 60, GetScreenWidth() - 120, GetScreenHeight() - 120, RL_LIGHTGRAY);
|
||||
|
||||
DrawRectangleRec(outerLeftRec, GRAY);
|
||||
DrawRectangleRec(innerLeftRec, RAYWHITE);
|
||||
DrawRectangleRec(outerRightRec, RAYWHITE);
|
||||
DrawRectangleRec(innerRightRec, GRAY);
|
||||
DrawRectangleRec(outerLeftRec, RL_GRAY);
|
||||
DrawRectangleRec(innerLeftRec, RL_RAYWHITE);
|
||||
DrawRectangleRec(outerRightRec, RL_RAYWHITE);
|
||||
DrawRectangleRec(innerRightRec, RL_GRAY);
|
||||
|
||||
if (levelFinished)
|
||||
{
|
||||
DrawRectangleBordersRec((Rectangle){0, 0, GetScreenWidth(), GetScreenHeight()}, 0, 0, 60, Fade(LIGHTGRAY, 0.6f));
|
||||
DrawText("LEVEL 01", GetScreenWidth()/2 - MeasureText("LEVEL 01", 30)/2, 20, 30, GRAY);
|
||||
DrawText(FormatText("DONE! (Seconds: %03i)", levelTimeSec), GetScreenWidth()/2 - MeasureText("DONE! (Seconds: 000)", 30)/2, GetScreenHeight() - 40, 30, GRAY);
|
||||
DrawRectangleBordersRec((Rectangle){0, 0, GetScreenWidth(), GetScreenHeight()}, 0, 0, 60, Fade(RL_LIGHTGRAY, 0.6f));
|
||||
DrawText("LEVEL 01", GetScreenWidth()/2 - MeasureText("LEVEL 01", 30)/2, 20, 30, RL_GRAY);
|
||||
DrawText(FormatText("DONE! (Seconds: %03i)", levelTimeSec), GetScreenWidth()/2 - MeasureText("DONE! (Seconds: 000)", 30)/2, GetScreenHeight() - 40, 30, RL_GRAY);
|
||||
}
|
||||
else DrawText("LEVEL 01", GetScreenWidth()/2 - MeasureText("LEVEL 01", 30)/2, 20, 30, LIGHTGRAY);
|
||||
else DrawText("LEVEL 01", GetScreenWidth()/2 - MeasureText("LEVEL 01", 30)/2, 20, 30, RL_LIGHTGRAY);
|
||||
}
|
||||
|
||||
// Level01 Screen Unload logic
|
||||
|
|
|
|||
|
|
@ -128,20 +128,20 @@ void DrawLevel02Screen(void)
|
|||
{
|
||||
// Draw Level02 screen
|
||||
|
||||
DrawCircleV(holeCirclePos, holeCircleRadius, LIGHTGRAY);
|
||||
DrawCircleV(bouncingBallPos, bouncingBallRadius, DARKGRAY);
|
||||
DrawCircleV(holeCirclePos, holeCircleRadius, RL_LIGHTGRAY);
|
||||
DrawCircleV(bouncingBallPos, bouncingBallRadius, RL_DARKGRAY);
|
||||
|
||||
DrawCircleLines(bouncingBallPos.x, bouncingBallPos.y, 120, Fade(LIGHTGRAY, 0.8f));
|
||||
DrawCircleLines(bouncingBallPos.x, bouncingBallPos.y, 120, Fade(RL_LIGHTGRAY, 0.8f));
|
||||
|
||||
|
||||
|
||||
if (levelFinished)
|
||||
{
|
||||
DrawRectangleBordersRec((Rectangle){0, 0, GetScreenWidth(), GetScreenHeight()}, 0, 0, 60, Fade(LIGHTGRAY, 0.6f));
|
||||
DrawText("LEVEL 02", GetScreenWidth()/2 - MeasureText("LEVEL 02", 30)/2, 20, 30, GRAY);
|
||||
DrawText(FormatText("DONE! (Seconds: %03i)", levelTimeSec), GetScreenWidth()/2 - MeasureText("DONE! (Seconds: 000)", 30)/2, GetScreenHeight() - 40, 30, GRAY);
|
||||
DrawRectangleBordersRec((Rectangle){0, 0, GetScreenWidth(), GetScreenHeight()}, 0, 0, 60, Fade(RL_LIGHTGRAY, 0.6f));
|
||||
DrawText("LEVEL 02", GetScreenWidth()/2 - MeasureText("LEVEL 02", 30)/2, 20, 30, RL_GRAY);
|
||||
DrawText(FormatText("DONE! (Seconds: %03i)", levelTimeSec), GetScreenWidth()/2 - MeasureText("DONE! (Seconds: 000)", 30)/2, GetScreenHeight() - 40, 30, RL_GRAY);
|
||||
}
|
||||
else DrawText("LEVEL 02", GetScreenWidth()/2 - MeasureText("LEVEL 02", 30)/2, 20, 30, LIGHTGRAY);
|
||||
else DrawText("LEVEL 02", GetScreenWidth()/2 - MeasureText("LEVEL 02", 30)/2, 20, 30, RL_LIGHTGRAY);
|
||||
}
|
||||
|
||||
// Level02 Screen Unload logic
|
||||
|
|
|
|||
|
|
@ -107,18 +107,18 @@ void UpdateLevel03Screen(void)
|
|||
void DrawLevel03Screen(void)
|
||||
{
|
||||
// Draw Level03 screen
|
||||
DrawRectangleRec(holeRec, GRAY);
|
||||
DrawRectangleRec(pieceRec, RAYWHITE);
|
||||
DrawRectangleRec(holeRec, RL_GRAY);
|
||||
DrawRectangleRec(pieceRec, RL_RAYWHITE);
|
||||
|
||||
if (showPiece) DrawRectangleLines(pieceRec.x, pieceRec.y, pieceRec.width, pieceRec.height, Fade(LIGHTGRAY, 0.8f));
|
||||
if (showPiece) DrawRectangleLines(pieceRec.x, pieceRec.y, pieceRec.width, pieceRec.height, Fade(RL_LIGHTGRAY, 0.8f));
|
||||
|
||||
if (levelFinished)
|
||||
{
|
||||
DrawRectangleBordersRec((Rectangle){0, 0, GetScreenWidth(), GetScreenHeight()}, 0, 0, 60, Fade(LIGHTGRAY, 0.6f));
|
||||
DrawText("LEVEL 03", GetScreenWidth()/2 - MeasureText("LEVEL 03", 30)/2, 20, 30, GRAY);
|
||||
DrawText(FormatText("DONE! (Seconds: %03i)", levelTimeSec), GetScreenWidth()/2 - MeasureText("DONE! (Seconds: 000)", 30)/2, GetScreenHeight() - 40, 30, GRAY);
|
||||
DrawRectangleBordersRec((Rectangle){0, 0, GetScreenWidth(), GetScreenHeight()}, 0, 0, 60, Fade(RL_LIGHTGRAY, 0.6f));
|
||||
DrawText("LEVEL 03", GetScreenWidth()/2 - MeasureText("LEVEL 03", 30)/2, 20, 30, RL_GRAY);
|
||||
DrawText(FormatText("DONE! (Seconds: %03i)", levelTimeSec), GetScreenWidth()/2 - MeasureText("DONE! (Seconds: 000)", 30)/2, GetScreenHeight() - 40, 30, RL_GRAY);
|
||||
}
|
||||
else DrawText("LEVEL 03", GetScreenWidth()/2 - MeasureText("LEVEL 03", 30)/2, 20, 30, LIGHTGRAY);
|
||||
else DrawText("LEVEL 03", GetScreenWidth()/2 - MeasureText("LEVEL 03", 30)/2, 20, 30, RL_LIGHTGRAY);
|
||||
}
|
||||
|
||||
// Level03 Screen Unload logic
|
||||
|
|
|
|||
|
|
@ -121,17 +121,17 @@ void UpdateLevel04Screen(void)
|
|||
void DrawLevel04Screen(void)
|
||||
{
|
||||
// Draw Level04 screen here!
|
||||
//DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), GRAY);
|
||||
DrawCircleV(circlesCenter, outerCircleRadius, GRAY);
|
||||
DrawCircleV(circlesCenter, innerCircleRadius, RAYWHITE);
|
||||
//DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), RL_GRAY);
|
||||
DrawCircleV(circlesCenter, outerCircleRadius, RL_GRAY);
|
||||
DrawCircleV(circlesCenter, innerCircleRadius, RL_RAYWHITE);
|
||||
|
||||
if (levelFinished)
|
||||
{
|
||||
DrawRectangleBordersRec((Rectangle){0, 0, GetScreenWidth(), GetScreenHeight()}, 0, 0, 60, Fade(LIGHTGRAY, 0.6f));
|
||||
DrawText("LEVEL 04", GetScreenWidth()/2 - MeasureText("LEVEL 04", 30)/2, 20, 30, GRAY);
|
||||
DrawText(FormatText("DONE! (Seconds: %03i)", levelTimeSec), GetScreenWidth()/2 - MeasureText("DONE! (Seconds: 000)", 30)/2, GetScreenHeight() - 40, 30, GRAY);
|
||||
DrawRectangleBordersRec((Rectangle){0, 0, GetScreenWidth(), GetScreenHeight()}, 0, 0, 60, Fade(RL_LIGHTGRAY, 0.6f));
|
||||
DrawText("LEVEL 04", GetScreenWidth()/2 - MeasureText("LEVEL 04", 30)/2, 20, 30, RL_GRAY);
|
||||
DrawText(FormatText("DONE! (Seconds: %03i)", levelTimeSec), GetScreenWidth()/2 - MeasureText("DONE! (Seconds: 000)", 30)/2, GetScreenHeight() - 40, 30, RL_GRAY);
|
||||
}
|
||||
else DrawText("LEVEL 04", GetScreenWidth()/2 - MeasureText("LEVEL 04", 30)/2, 20, 30, LIGHTGRAY);
|
||||
else DrawText("LEVEL 04", GetScreenWidth()/2 - MeasureText("LEVEL 04", 30)/2, 20, 30, RL_LIGHTGRAY);
|
||||
}
|
||||
|
||||
// Level04 Screen Unload logic
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue