Commit 145dd4de authored by Max Kobelt's avatar Max Kobelt
Browse files

Remove code duplication

parent ec4641d9
......@@ -47,7 +47,6 @@ void calcGame() {
}
void drawGame() {
ClearBackground(BLACK);
DrawRectangleRec(laserCanon, WHITE);
DrawRectangleLines((int) gameBorder.x, (int) gameBorder.y, (int) gameBorder.width, (int) gameBorder.height, WHITE);
......
......@@ -48,6 +48,7 @@ int main() {
BeginDrawing();
ClearBackground(BLACK);
BeginTextureMode(target);
ClearBackground(BLACK);
if (state == MENU) {
drawMenu();
} else if (state == GAME) {
......
......@@ -37,7 +37,6 @@ void calcMenu() {
}
void drawMenu() {
ClearBackground(BLACK); // To clear the screen when you go back into the menu
DrawText("PLAY", (int) playBtnPos.x, (int) playBtnPos.y, PLAY_FONT_SIZE, RED);
DrawRectangleRec(inputBox, LIGHTGRAY);
DrawRectangleLines((int) inputBox.x, (int) inputBox.y, (int) inputBox.width, (int) inputBox.height, RED);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment