55 lines
2.2 KiB
C++
55 lines
2.2 KiB
C++
/*******************************************************************************************
|
|
*
|
|
* LayoutName v1.0.0 - Tool Description
|
|
*
|
|
* LICENSE: Propietary License
|
|
*
|
|
* Copyright (c) 2022 raylib technologies. All Rights Reserved.
|
|
*
|
|
* Unauthorized copying of this file, via any medium is strictly prohibited
|
|
* This project is proprietary and confidential unless the owner allows
|
|
* usage in any other form by expresely written permission.
|
|
*
|
|
**********************************************************************************************/
|
|
|
|
#pragma once
|
|
|
|
#include "raygui.h"
|
|
#include "raylib.h"
|
|
|
|
inline constexpr float WINDOW_WIDTH = 700;
|
|
inline constexpr float WINDOW_HEIGHT = 460;
|
|
|
|
//----------------------------------------------------------------------------------
|
|
// Controls Functions Declaration
|
|
//----------------------------------------------------------------------------------
|
|
|
|
inline void DrawHud(float value, int stars) {
|
|
GuiProgressBar((Rectangle){72, 440, 120, 16}, "ENERGY", nullptr, value, 0, 1);
|
|
GuiLabel((Rectangle){24, 8, 120, 24}, TextFormat("STARS: x%d", stars));
|
|
}
|
|
|
|
inline void DrawMainMenu() {
|
|
GuiLabel((Rectangle){WINDOW_WIDTH / 2 - 100, WINDOW_HEIGHT / 2 - 60, 200, 40},
|
|
"GRAVITY SURFING");
|
|
|
|
GuiLabel((Rectangle){WINDOW_WIDTH / 2 - 200, WINDOW_HEIGHT / 2, 400, 60},
|
|
"LEFT CLICK to place a black hole that lasts 1 second\n"
|
|
"Each black hole costs 10 meter and does not drain over time\n"
|
|
"Avoid hazards and collect stars to refill meter\n"
|
|
"Place as many black holes as your meter allows\n"
|
|
"Press SPACE or LEFT CLICK to start");
|
|
}
|
|
|
|
inline void DrawDeathStats(int stars) {
|
|
GuiLabel((Rectangle){WINDOW_WIDTH / 2 - 150, WINDOW_HEIGHT / 2 - 40, 300, 32}, "YOU DIED");
|
|
GuiLabel((Rectangle){WINDOW_WIDTH / 2 - 150, WINDOW_HEIGHT / 2 - 4, 300, 24},
|
|
TextFormat("Stars Collected: %d", stars));
|
|
GuiLabel((Rectangle){WINDOW_WIDTH / 2 - 150, WINDOW_HEIGHT / 2 + 28, 300, 20},
|
|
"Press ENTER or LEFT CLICK to retry");
|
|
}
|
|
|
|
//------------------------------------------------------------------------------------
|
|
// Controls Functions Definitions (local)
|
|
//------------------------------------------------------------------------------------
|